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 8082
port. (do not update any other Apache configuration settings like document root etc).
ssh tony@stapp01
cd /opt/docker
sudo vi Dockerfile
# a) Use ubuntu:24.04 as base image
FROM ubuntu:24.04
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# b) Install apache2
RUN apt-get update && \
apt-get install -y apache2 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Configure Apache to listen on port 8082
RUN sed -i 's/Listen 80/Listen 8082/' /etc/apache2/ports.conf && \
sed -i 's/<VirtualHost \*:80>/<VirtualHost *:8082>/' /etc/apache2/sites-available/000-default.conf
# Expose the new port
EXPOSE 8082
# Start Apache in foreground (so container keeps running)
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
esc wq!
# Build the docker image
docker build -t custom-apache:latest .
[+] Building 17.3s (7/7) FINISHED docker:default
=> [internal] load build definition from Dockerfile
=> => transferring dockerfile: 681B
=> [internal] load metadata for docker.io/library/ubuntu:24.04
=> [internal] load .dockerignore
=> => transferring context: 2B
=> [1/3] FROM docker.io/library/ubuntu:24.04
=> [2/3] RUN apt-get update && apt-get install -y apache2 && apt-get
=> [3/3] RUN sed -i 's/Listen 80/Listen 8082/' /etc/apache2/ports.conf &&
=> exporting to image
=> => exporting layers
=> => writing image sha256:28f3fda445584ce33e538fd8aef8c782acdb680abe95c376c179b 0.0s
=> => naming to docker.io/library/custom-apache:latest
# Test the image by running a new container (optional)
docker run -d --name test-apache -p 8082:8082 custom-apache:latest