0

I am new to Containers and trying wrap my head around it using the tutorial:

http://containertutorials.com/alpine/alpine-apache-server-static-site.html

Here I create the dockerfile and try to run the container but it fails everytime. Any pointers?

root@ubuntu:/home/skorada# docker run -it -p 4000:80 --name my-apache2- alpine-1  my-apache2-alpine
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 30-resolver: executing... 
[cont-init.d] 30-resolver: exited 0.
[cont-init.d] 40-resolver: executing... 
[cont-init.d] 40-resolver: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
AH00558: httpd: Could not reliably determine the server's fully qualified  domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

This is my dockerfile

FROM smebberson/alpine-apache
ADD ./public-html/myindex.html /var/www/localhost/htdocs
RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf

Why doesnt the docker container up and running ? Unable to figure it out. Have looked through different links but nothing has helped out so far.

skorada
  • 431
  • 1
  • 4
  • 15

1 Answers1

2

It's a known issue with that docker image. See this issue and this. It's not getting fixed for nearly a year now so my advice is to use another Docker image with Apache.

You can try the official repo. Just cd into directory with your files and

docker run -dit --name my-apache-app -p 8080:80 -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4

Go to localhost:8080 and that's it.

Andrija Ćeranić
  • 1,633
  • 11
  • 14