The Nautilus team wants to create a debug container on Application Server 2. However, they had some specific requirements related to the CMD. Please complete the task as per details given below:
a. On Application Server 2 create a container named debug_2 using image ubuntu/apache2:latest.
b. Overwrite the default CMD with command sleep 1000.
c. Make sure the container is in running state.
sudo docker run -d --name debug_2 ubuntu/apache2:latest sleep 1000
# Check the running process
sudo docker exec debug_2 ps aux
The Nautilus DevOps team is testing some applications deployment on some of the application servers. They need to deploy a nginx container on Application Server 2. Please complete the task as per details given below:
On Application Server 2 create a container named nginx_2 using image nginx with alpine tag and make sure container is in running state.
sudo docker run -d --name nginx_2 -p 8080:80 nginx:alpine
The Nautilus DevOps team has some confidential data present on App Server 2 in Stratos Datacenter. There is a container ubuntu_latest running on the same server. We received a request to copy some of the data from the docker host to the container. Below are more details about the task:
On App Server 2 in Stratos Datacenter copy an encrypted file /tmp/nautilus.txt.gpg from docker host to ubuntu_latest container (running on same server) in /usr/src/ location (create this location if doesn't exit). Please do not try to modify this file in any way.
# Create destination directory if needed
docker exec ubuntu_latest mkdir -p /usr/src/
# Copy the file
docker cp /tmp/nautilus.txt.gpg ubuntu_latest:/usr/src/
# Verify file exists in container
docker exec ubuntu_latest ls -la /usr/src/nautilus.txt.gpg
# Verify file integrity (checksums should match)
md5sum /tmp/nautilus.txt.gpg
docker exec ubuntu_latest md5sum /usr/src/nautilus.txt.gpg
We received a request to copy some of the data from one of the docker containers to the docker host. The container is running on App Server 2 in Stratos Datacenter. Below are more details about the task:
On App Server 2 in Stratos Datacenter copy an encrypted file /tmp/test.txt.gpg from development_3 docker container to the docker host in /tmp location. Please do not try to modify this file in any way.
# Verify source file exists in container
docker exec development_3 ls -la /tmp/test.txt.gpg
# Copy the file from container to host
docker cp development_3:/tmp/test.txt.gpg /tmp/
# Verify file exists on host
ls -la /tmp/test.txt.gpg
# Verify file integrity (checksums should match)
docker exec development_3 md5sum /tmp/test.txt.gpg
md5sum /tmp/test.txt.gpg
The Nautilus DevOps team wanted to transfer some docker images from one server to another server so they wanted to save some docker images as tar archives on the docker host itself. Find below the exact requirements:
There is a docker image named nginx:mainline-alpine-slim on App Server 2 in Stratos Datacenter, save this image as nginx.tar archive under /home directory on the same server.
# Verify image exists
docker images nginx:mainline-alpine-slim
# Save image as tar archive
docker save -o /home/nginx.tar nginx:mainline-alpine-slim
# Verify file was created
ls -la /home/nginx.tar
# Check file size
du -h /home/nginx.tar
# Verify it's a valid tar
tar -tf /home/nginx.tar
# This `nginx.tar` archive can later be transferred to another server and loaded using:
docker load -i nginx.tar
- The
docker savecommand preserves the image's layers, tags, and metadata - The tar file can be transferred to other servers and loaded using
docker load - Using
-ospecifies the output file; without it, the output goes to STDOUT - The file will be saved to
/home/nginx.taras requested
There is a docker image on Application Server 2 in Stratos DC. This image needs to be retagged as per details given below:
Re-tag the nginx:mainline-alpine3.18-slim image as nginx:nautilus
# Verify image exists
docker images nginx:mainline-alpine3.18-slim
# Retag the image
docker tag nginx:mainline-alpine3.18-slim nginx:nautilus
# Retag with different repository
docker tag nginx:mainline-alpine3.18-slim myregistry/nginx:nautilus
# Remove the original tag
docker rmi nginx:mainline-alpine3.18-slim
The Nautilus DevOps team is planning to do some cleanup on App Server 2 in Stratos Datacenter, some old and unused docker networks need to be deleted. Find below more details:
Delete a docker network named php-network from App Server 2 in Stratos Datacenter.
# Check if php-network exists
docker network ls | grep php-network
# Inspect the network (to see connected containers)
docker network inspect php-network
# Delete the network
docker network rm php-network
# Stop containers using the network
docker ps --filter network=php-network -q | xargs docker stop
# Then delete
docker network rm php-network
The Nautilus DevOps team is planning to setup/create some docker containers on App Server 2 in Stratos Datacenter, some prerequisites are needs to be done on this server. Find below more details:
Create a new network named mysql-network using the bridge driver. Allocate subnet 182.18.0.0/24, configure Gateway 182.18.0.1.
# Create the network
docker network create --driver bridge --subnet 182.18.0.0/24 --gateway 182.18.0.1 mysql-network
# Run a container with this network
docker run -d --name mysql --network mysql-network mysql:latest
-
--driver bridge: Use the bridge driver (default) -
--subnet 182.18.0.0/24: Allocate the specified subnet -
--gateway 182.18.0.1: Configure the specified gateway -
mysql-network: The name of the network to create
There was a docker container deployed on App Server 2. Suddenly, team found that the container is crashing. Look into the issue to fix the same, you can find more details below:
The container name is apple_alpine. You can even re-create the container if needed, just make sure its in running state.
# Alpine Linux uses `sh` instead of `bash`
# Option 1: Recreate the container with shell override
# Remove the existing container
sudo docker rm -f apple_alpine
# Recreate with a shell that works in Alpine
sudo docker run -d --name apple_alpine nginx:stable-alpine3.17-slim sh -c "nginx -g 'daemon off;'"
# Option 2: install bash
# Remove the existing container
sudo docker rm -f apple_alpine
# Run a new container and install bash
sudo docker run -d --name apple_alpine --entrypoint sh nginx:stable-alpine3.17-slim -c "apk add --no-cache bash && nginx -g 'daemon off;'"
Top comments (0)