3

Dockerfile在亚马逊Web服务我公司推出两种环境与2 Dockerfile(一个与Ubuntu,以及一个在Debian)在亚马逊网络服务(青苗)故障与魔豆

DOCKERFILE UBUNTU:

FROM ubuntu:12.04 

RUN apt-get update 
RUN apt-get install -y emacs apt-utils 
RUN apt-get install -y php5 php5-cli ldap-utils apache2 libapache2-mod-php5 php5-mysql 
         php-pear php5-dev php5-gd php5-mcrypt 
RUN apt-get install -y libapache2-mod-auth-mysql 
RUN apt-get install -y curl libcurl3 libcurl3-dev php5-curl 
RUN apt-get install -y zziplib-bin 
RUN apt-get install -y openssl 

RUN a2enmod php5 
RUN a2enmod rewrite 

ENV APACHE_RUN_USER www-data 
ENV APACHE_RUN_GROUP www-data 
ENV APACHE_LOG_DIR /var/log/apache2 
ENV APACHE_LOCK_DIR /var/lock/apache2 
ENV APACHE_PID_FILE /var/run/apache2.pid 

EXPOSE 80 

CMD /usr/sbin/apache2ctl -D FOREGROUND 

DOCKERFILE DEBIAN:

FROM debian 

RUN apt-get update 
RUN apt-get install -y emacs apt-utils 
RUN apt-get install -y php5 php5-cli ldap-utils apache2 libapache2-mod-php5 php5-mysql 
         php-pear php5-dev php5-gd php5-mcrypt 
RUN apt-get install -y libapache2-mod-auth-mysql 
RUN apt-get install -y curl libcurl3 libcurl3-dev php5-curl 
RUN apt-get install -y zziplib-bin 
RUN apt-get install -y openssl 

RUN a2enmod php5 
RUN a2enmod rewrite 

ENV APACHE_RUN_USER www-data 
ENV APACHE_RUN_GROUP www-data 
ENV APACHE_LOG_DIR /var/log/apache2 
ENV APACHE_LOCK_DIR /var/lock/apache2 
ENV APACHE_PID_FILE /var/run/apache2.pid 

EXPOSE 80 

CMD /usr/sbin/apache2ctl -D FOREGROUND 

我不明白为什么了Debian版本不工作...

我只有这个错误:

创建环境操作完成,但与命令超时。尝试增加超时时间。有关更多信息,请参阅故障诊断文档

你能帮助我吗?有任何想法吗 ?

回答

0

这是因为下载和构建docker映像所花费的时间可能是可变的。您可以使用选项设置增加超时时间。我以前在这里的回答

复制:https://stackoverflow.com/a/25558805/161628

选项设置可以使用ebextensions指定。

在您的应用程序源中创建一个名为.ebextensions的目录中的文件。可以说这个文件是.ebextensions/01-increase-timeout.config

该文件的内容应该是:

option_settings: 
    - namespace: aws:elasticbeanstalk:command 
     option_name: Timeout 
     value: 1000 

注意此文件是YAML格式。 之后,您可以使用此版本的源代码更新您的环境。

从该选项设置文档:

Timeout: Number of seconds to wait for an instance to complete executing commands. 

For example, if source code deployment tasks are still running when you reach the configured timeout period, AWS Elastic Beanstalk displays the following error: "Some instances have not responded to commands. Responses were not received from <instance id>." You can increase the amount of time that the AWS Elastic Beanstalk service waits for your source code to successfully deploy to the instance. 

你可以阅读更多关于ebextensions here。关于选项设置的文档可用here