Reputation: 311
My base image is centos/systemd.so
my cmd will contain /usr/sbin/init
but i also want to run a shell script file when the container gets created.
my Dockerfile:
FROM centos/systemd
#RUN yum -y install dos2unix
CMD ["usr/sbin/init"] //here i also want to launch a shell script file
Upvotes: 2
Views: 3441
Reputation: 710
Edit with the solution:
FROM centos/systemd
ADD /path-to-hello/hello.sh ./
ENTRYPOINT ["./hello.sh"]
The last line in hola.sh
is exec /usr/sbin/init
Build docker: docker build -t DockerImageName:1.0 .
Run docker: docker run --name DockerName DockerImageName:1.0
Upvotes: 1