【发布时间】:2014-07-17 23:08:57
【问题描述】:
我正在尝试在 AWS 上使用 Beanstalk。我正在尝试使用 Dockerrun.aws.json 创建一个实例(微),如下所示:
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "coaxys/play-127",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "9080"
}
],
"Volumes": [
{
"HostDirectory": "/var/app/mydb",
"ContainerDirectory": "/etc/mysql"
}
],
"Logging": "/var/log/nginx"
}
但是在它完成之后,我需要运行一个我已经放在我的 .zip 中的脚本。这可能吗?我尝试创建一个 Dockerfile,但没有识别出我指定的图像。这是 Dockerfile:
FROM ubuntu
MAINTAINER Nicolas Giard, nicolas.giard@coaxys.com
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update && apt-get -y install python-software-properties
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install unzip && apt-get clean
RUN mkdir /opt/play && cd /opt/play
RUN wget http://downloads.typesafe.com/play/1.2.7/play-1.2.7.zip
RUN unzip play-1.2.7.zip
RUN mv play-1.2.7 /opt/play
RUN update-alternatives --install /usr/bin/play play /opt/play/play-1.2.7/play 1
RUN echo "PLAY_HOME=/opt/play/play-1.2.7" >> /etc/environmentRUN echo "PLAY_HOME=/opt/play/play-1.2.7" >> /etc/environment
RUN mkdir -p /opt/deploy
RUN sudo mv /etc/localtime /etc/localtime.org
RUN sudo ln -sf /usr/share/zoneinfo/Brazil/East /etc/localtime
RUN export PLAY_HOME=/opt/play
RUN export PATH=$PLAY_HOME:$PATH
EXPOSE 9080
是否可以从 Dockerrun.aws.json 调用可执行文件或我的 Dockerfile 有问题?
【问题讨论】:
标签: amazon-web-services playframework amazon-elastic-beanstalk docker