container
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? |
You've not use code tags properly, so it's difficult to parse, but the relevant part is this:
Code:
e12c1a9bf934 image "/bin/sh -c ./run.sh" Exited (127) test54 It's probably because you've got this in run.sh: "/sr/sbin/httpd -D FOREGROUND" - there is a missing u before sr so it can't find it. |
From the Dockerfile reference:
Quote:
|
One thing to also note, is that you will need an 'EXPOSE' command in your dockerfile, to allow that port to be exposed from the image itself.
|
All times are GMT -5. The time now is 12:47 PM. |