这是我的Dockerfile
# This Dockerfile describes the standard way to build
FROM centos:latest
MAINTAINER praveen
# Run a root to allow "rpm"
USER root
WORKDIR /root/
# Get the ACE-TAO rpm from seachange repo
COPY TAO-1.7.7-0.x86_64.rpm /root/TAO-1.7.7-0.x86_64.rpm
# Insatall the rpm
RUN rpm -ivh /root/TAO-1.7.7-0.x86_64.rpm
#Start the TAO service
#CMD /etc/init.d/tao start
COPY namingServiceConfig.sh /
RUN /namingServiceConfig.sh
EXPOSE 13021
EXPOSE 13022
EXPOSE 13023
ENV NS_PORTS=13021,13022,13023
#ENTRYPOINT /etc/init.d/tao start && bash在进行对接构建时,无论是执行shell脚本并将更改作为部分映像反映,还是使用运行映像时,运行,它都将反映对容器级别的更改
在我的例子中,我怀疑它是在同时运行的同时执行的
我正在使用下面的命令作为通过迷航文件构建和运行的一部分
d.build_image "/vagrant/tao", args: " -t tao/basic"
d.run "tao/basic:latest",
args: " -t -d"\
" --name tao-basic"\
" -p 13021:13021"\
" -e NS_PORT=13025,13026,13027"告诉我,需要更多的信息
发布于 2016-11-27 04:24:05
Dockerfile指令(如RUN等)在构建时被激活(docker build -t something .等)。只有CMD和ENTRYPOINT指令发生在运行时(当容器启动时)。
在您的示例中,shell脚本将作为构建的一部分运行,发生的任何更改都将作为映像中的一个新层提交。
https://stackoverflow.com/questions/40825707
复制相似问题