As per recent requirements shared by the Nautilus application development team, they need custom images created for one of their projects. Several of the initial testing requirements are already been shared with DevOps team. Therefore, create a docker file /opt/docker/Dockerfile (please keep D capital of Dockerfile) on App server 1 in Stratos DC and configure to build an image with the following requirements:
a. Use ubuntu:24.04 as the base image.
b. Install apache2 and configure it to work on 6000 port. (do not update any other Apache configuration settings like document root etc).
Step-by-Step Solution
Step 1: SSH to App Server 1
ssh tony@stapp01
# Password: Ir0nM@n
Step 2: Switch to Root (if needed)
sudo su -
# Password: Ir0nM@n
Step 3: Create the Directory
# Create the /opt/docker directory
mkdir -p /opt/docker
# Navigate to the directory
cd /opt/docker
Step 4: Create the Dockerfile
# Create Dockerfile with capital D
vi Dockerfile
Step 5: Add Content to Dockerfile
# Use ubuntu:24.04 as base image
FROM ubuntu:24.04
# Update package list and install apache2
RUN apt-get update && \
apt-get install -y apache2 && \
apt-get clean
# Expose port 6000
EXPOSE 6000
# Configure Apache to listen on port 6000
RUN sed -i 's/Listen 80/Listen 6000/g' /etc/apache2/ports.conf && \
sed -i 's/:80>/:6000>/g' /etc/apache2/sites-available/000-default.conf
# Start Apache in foreground
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
📊 Verification Commands
Check Dockerfile:
# Check file exists
ls -la /opt/docker/Dockerfile
# View content
cat /opt/docker/Dockerfile
Build and Test Image (Optional):
# Build the image
docker build -t apache2:6000 /opt/docker/
# Run the container
docker run -d --name apache2-test -p 6000:6000 apache2:6000
# Test Apache
curl http://localhost:6000
# Clean up
docker stop apache2-test
docker rm apache2-test
✅ Task Summary
| Requirement | Status |
|---|---|
| SSH to App Server 1 | ✅ |
| Create /opt/docker directory | ✅ |
| Create Dockerfile (capital D) | ✅ |
| Use ubuntu:24.04 base image | ✅ |
| Install apache2 | ✅ |
| Configure Apache port 6000 | ✅ |
| No other configuration changes | ✅ |
Top comments (0)