首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Dockerfile运行多个命令不起作用

Dockerfile运行多个命令不起作用
EN

Stack Overflow用户
提问于 2019-09-16 12:24:29
回答 1查看 301关注 0票数 0

我是新来docker社区,我想为我的php网站的网页面板图像当我运行docker图像构建命令时,我面对这个错误,请一些帮助我已经过去了4天,仍然卡在this.in执行它的显示错误。This is error snap Shot Link

代码语言:javascript
复制
#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
EN

回答 1

Stack Overflow用户

发布于 2019-09-16 14:05:57

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

代码语言:javascript
复制
#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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57950367

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档