Running the HTTP server image as a service

In this section, we are going to launch a container using the Apache HTTP server image, we crafted in the previous section. Here, we launch the container in the detached mode (similar to the UNIX daemon process) using the -d option of the docker run subcommand:

$ sudo docker run -d apache2
9d4d3566e55c0b8829086e9be2040751017989a47b5411c9c4f170ab865afcef

Having launched the container, let's run the docker logs subcommand to see whether our Docker container generates any output on its stdin (standard input) or stderr (standard error):

$ sudo docker logs 
9d4d3566e55c0b8829086e9be2040751017989a47b5411c9c4f170ab865afcef

As we have not fully configured the Apache HTTP server, you will find the following warning, as the output of the docker logs subcommand:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.13. Set the 'ServerName' directive globally to suppress this message

From the preceding warning message, it is quite evident that the IP address assigned to this container is 172.17.0.13.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset