码迷,mamicode.com
首页 > 其他好文 > 详细

踩了的Dockerfile的坑

时间:2017-06-08 16:33:06      阅读:381      评论:0      收藏:0      [点我收藏+]

标签:ror   doc   error   stat   没有   linux   启动   blog   start   

1、Dockerfile VOLUME的目录,RUN命令操作该目录无效

VOLUME $APP_HOME

RUN mkdir -p $APP_HOME && mkdir -p $APP_HOME/config && mkdir -p $APP_HOME/logs

RUN chown -R $USER_GROUP_NAME "$APP_HOME"

Dockerfile VOLUME了目录$APP_HOME之后,RUN 命令的 mkdir -p $APP_HOME/config && mkdir -p $APP_HOME/logs 和 chown全部不生效,config,logs目录没有被创建,COPY到$APP_HOME下的文件owner依然是root。

2、ENTRYPOINT的数组参数不能使用ENV变量

ENV APP_HOME=/opt/app
ENTRYPOINT [ "$APP_HOME/entrypoint.sh" ]
在启动docker容器时报错,docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"$APP_HOME/entrypoint.sh\": stat $APP_HOME/entrypoint.sh: no such file or directory".

踩了的Dockerfile的坑

标签:ror   doc   error   stat   没有   linux   启动   blog   start   

原文地址:http://www.cnblogs.com/leolztang/p/6963393.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!