The Nautilus DevOps team is conducting application deployment tests on selected application servers. They require a nginx container deployment on Application Server 1. Complete the task with the following instructions:
On Application Server 1 create a container named nginx_1 using the nginx image with the alpine tag. Ensure container is in a running state.
Step-by-Step Instructions
1. SSH into Application Server 1
ssh steve@stapp01
(Enter the password when prompted)
2. Switch to root or use sudo
sudo su -
or prefix all commands with sudo
3. Verify Docker is installed and running
docker --version
sudo systemctl status docker
If Docker isn't running, start it:
sudo systemctl start docker
sudo systemctl enable docker
4. Pull the nginx image with alpine tag
sudo docker pull nginx:alpine
5. Create and run the container named nginx_1
sudo docker run -d --name nginx_1 nginx:alpine
Explanation of options:
-
-d: Run container in detached mode (background) -
--name nginx_1: Assign the name "nginx_1" to the container -
nginx:alpine: Use the nginx image with alpine tag
6. Verify the container is running
sudo docker ps
You should see output similar to:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
xxxxxxxxxxxx nginx:alpine "/docker-entrypoint.…" x seconds ago Up x seconds nginx_1
7. Additional verification (optional)
Check container details:
sudo docker inspect nginx_1
Test if nginx is working (get container IP):
sudo docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx_1
Complete One-Line Command
If you want to do it all at once (after SSH into stapp01):
sudo docker run -d --name nginx_1 nginx:alpine
Summary of Commands
# SSH to App Server 1
ssh steve@stapp01
# Run the container
sudo docker run -d --name nginx_1 nginx:alpine
# Verify
sudo docker ps
Verification Checklist
- [ ] Container name is nginx_1
- [ ] Image used is nginx:alpine
- [ ] Container is in running state (
Upstatus indocker ps)
Top comments (0)