Dockerfile RUN多个命令不起作用

时间:2019-09-16 04:24:28

标签: docker docker-compose dockerfile docker-swarm

当我运行docker image building命令时,我是docker社区的新成员,我想要php网站的webpanel图像我遇到此错误,请有些帮助我已经过去了4天,但仍停留在this.in中,执行中显示错误。 This is error snap Shot Link

#Docker File Code.
FROM lolhens/baseimage:latest
MAINTAINER LolHens <pierrekisters@gmail.com>

RUN apt-get update 
RUN apt-get install -y \
curl
RUN cd /tmp 
RUN curl http://vestacp.com/pub/vst-install.sh | bash -s \
    y no -f \
    password admin \
    nginx yes \
    apache yes \
    phpfpm no \
    vsftpd no \
    proftpd no \
    exim yes \
    dovecot yes \
    spamassassin yes \
    clamav yes \
    named yes \
    iptables no \
    fail2ban no \
    mysql no \
    postgresql yes \
    remi yes \
    quota yes \
    cleanimage

ADD dovecot /etc/init.d/dovecot
RUN chmod +x /etc/init.d/dovecot

RUN cd /usr/local/vesta/data/ips && mv * 127.0.0.1 \
 && cd /etc/apache2/conf.d && sed -i -- 's/172.*.*.*:80/127.0.0.1:80/g' * && sed -i -- 's/172.*.*.*:8443/127.0.0.1:8443/g' * \
 && cd /etc/nginx/conf.d && sed -i -- 's/172.*.*.*:80;/80;/g' * && sed -i -- 's/172.*.*.*:8080/127.0.0.1:8080/g' * \
 && cd /home/admin/conf/web && sed -i -- 's/172.*.*.*:80;/80;/g' * && sed -i -- 's/172.*.*.*:8080/127.0.0.1:8080/g' *

ADD startup.sh /etc/my_init.d/startup.sh
RUN chmod +x /etc/my_init.d/startup.sh


CMD bash


EXPOSE 80 8083 8080 3306 443 25 993 110 53 54

1 个答案:

答案 0 :(得分:0)

您需要使用以下代码段替换脚本的第一部分(其余部分保持不变,我无法测试该部分)。我添加了解释这些新行的内联注释。

#Docker File Code.
FROM lolhens/baseimage:latest
MAINTAINER LolHens <pierrekisters@gmail.com>

RUN apt-get update
RUN apt-get install -y \
curl
RUN cd /tmp

# First save the script locally
RUN curl -O http://vestacp.com/pub/vst-install.sh

# Make the script runnable
RUN chmod a+x ./vst-install.sh

# Disable the apt-get check for unauthenticated packages
RUN echo "APT::Get::AllowUnauthenticated \"true\";" > /etc/apt/apt.conf.d/99vesta

# Pass 'yes' automatically when asked
RUN yes | ./vst-install.sh -y no -p admin \
    nginx yes \
    apache yes \
    phpfpm no \
    vsftpd no \
    proftpd no \
    exim yes \
    dovecot yes \
    spamassassin yes \
    clamav yes \
    named yes \
    iptables no \
    fail2ban no \
    mysql no \
    postgresql yes \
    remi yes \
    quota yes \
    cleanimage