An issue has arisen with a static website running in a container named nautilus
on App Server 1
. To resolve the issue, investigate the following details:
1. Check if the container's volume /usr/local/apache2/htdocs
is correctly mapped with the host's volume /var/www/html
.
2. Verify that the website is accessible on host port 8080
on App Server 1
. Confirm that the command curl http://localhost:8080/
works on App Server 1
.
ssh tony@stapp01
# List all containers - running, stopped and exited
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS 386e19d7b413 httpd "httpd-foreground" 2 minutes ago Exited (0) 2 minutes ago nautilus
# Status "Exited" shows that container is not running
# Checking to ensure mapping is correct for source and destination
docker inspect nautilus | grep -A5 "Mounts"
"Mounts": [
{
"Type": "bind",
"Source": "/var/www/html",
"Destination": "/usr/local/apache2/htdocs",
"Mode": "",
# Restarting the docker container
docker start nautilus
# Verifying the container is running and checking with curl
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
386e19d7b413 httpd "httpd-foreground" 7 minutes ago Up 4 seconds 0.0.0.0:8080->80/tcp nautilus
curl http://localhost:8080/
Welcome to xFusionCorp Industries!