我試圖將Spring Boot應用程序的Docker映像部署到AWS Elastic Beanstalk,並且在/var/log/eb-activity.log中遇到此錯誤:無法訪問jarfile - Elastic Beanstalk上的Docker
Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Wed Jun 22 11:56:25 UTC 2016:
Error: Unable to access jarfile /home/packedit/app/packed-it.jar. Check snapshot logs for details. (Executor::NonZeroExitStatus)
這是彈性豆莖單個容器具有以下Dockerrun.aws.json:
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "packedit/packedit-api",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "8080"
}
],
"Volumes": [
{
"HostDirectory": "/var/app/packedit",
"ContainerDirectory": "/home/packedit/app"
}
],
"Logging": "/home/packedit/app/logs"
}
這是Dockerfile:
FROM java:8
MAINTAINER [email protected]
VOLUME /tmp
EXPOSE 8080
ENV USER_NAME packedit
ENV APP_HOME /home/$USER_NAME/app
ENV APP_FILENAME packed-it.jar
RUN useradd -ms /bin/bash $USER_NAME
RUN mkdir -p $APP_HOME/data
ADD $APP_FILENAME $APP_HOME/$APP_FILENAME
RUN chown -R $USER_NAME $APP_HOME/
USER $USER_NAME
WORKDIR $APP_HOME
RUN bash -c 'touch $APP_FILENAME'
# Can't use $APP_FILENAME here because ENTRYPOINT does not do ENV replacement
# See: http://stackoverflow.com/a/28854410/336752
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","packed-it.jar"]
我已經成功地將Docker映像部署到使用ECS的EC2實例,但我還沒有成功使用Elastic Beanstalk。我的猜測是,我在捲上做錯了事,但我正在努力去理解documentation。我最初是從一個多容器配置開始的,但是已經簡化了嘗試並隔離我的問題。
感謝您的任何建議。
輝煌!非常感謝,這確實是罪魁禍首。事實上,我刪除了整個'卷'屬性。現在我可以配置多容器了... – Stu