Build NGINX Image

  1. Create a Dockerfile named Dockerfile.nginx inside the /home/admin/hsm-build directory.

  1. Add the following contents to the Dockerfile.nginx file and save it.

    Docker
    FROM redhat/ubi9:latest
     
    # Install NGINX + OpenSSL + PKCS#11 engine
    RUN dnf install -y nginx openssl openssl-pkcs11 && dnf clean all
     
    # Expose port and start NGINX
    EXPOSE 443
    CMD ["/usr/sbin/nginx", "-g", "daemon off;"]
    
  2. Build the nginx image using the Dockerfile.

Screenshot 2025-10-21 193542-20251028-102915.png

Build nginx Image

In the example command, replace <username> with your actual Docker Hub username when building the image (e.g., docker build -f Dockerfile.nginx -t <your-username>/nginx:1 .).

The screenshots in this guide show the build process with the username blurred for security reasons. Use your own Docker Hub username while executing the commands in your environment.

  1. Verify that the image has been built successfully and push it to your Docker repository.

blurred Screenshot 2025-10-21 151959-20251030-090109.jpg


Verify and Push nginx Image