Article 5AWRX container

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?latest?d=yIl2AUoC8zA latest?i=l9YQuZfIUI8:PZxzRU7w6KE:F7zBnMy latest?i=l9YQuZfIUI8:PZxzRU7w6KE:V_sGLiP latest?d=qj6IDK7rITs latest?i=l9YQuZfIUI8:PZxzRU7w6KE:gIN9vFwl9YQuZfIUI8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments