container
by yangyiin from LinuxQuestions.org on (#5AWRX)
hi,
i like to deploy http inside of docker with ansible.
[code]
more Dockerfile
FROM centos
RUN /usr/bin/yum -y install httpd
COPY index.html /var/www/html/index.html
COPY run.sh run.sh
CMD ./run.sh
more run.sh
exec /sr/sbin/httpd -D FOREGROUND
run.sh is executable
then
docker build -t image .
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
image latest e4d86712928a
more yd.yml
- name: test
hosts: localhost
tasks:
- name: test4
docker_container:
name: test54
image: image
state: started
ports:
- "8080:80"
tty: true
detach: true
ansible-playbook yd.yml
docker ps -a
CONTAINER ID IMAGE COMMAND
e12c1a9bf934 image "/bin/sh -c ./run.sh" Exited (127) test54
Why this container exited?


i like to deploy http inside of docker with ansible.
[code]
more Dockerfile
FROM centos
RUN /usr/bin/yum -y install httpd
COPY index.html /var/www/html/index.html
COPY run.sh run.sh
CMD ./run.sh
more run.sh
exec /sr/sbin/httpd -D FOREGROUND
run.sh is executable
then
docker build -t image .
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
image latest e4d86712928a
more yd.yml
- name: test
hosts: localhost
tasks:
- name: test4
docker_container:
name: test54
image: image
state: started
ports:
- "8080:80"
tty: true
detach: true
ansible-playbook yd.yml
docker ps -a
CONTAINER ID IMAGE COMMAND
e12c1a9bf934 image "/bin/sh -c ./run.sh" Exited (127) test54
Why this container exited?