← Back to blog
bpdubuntu

CI/CD Pipeline Step 1: Building and Pushing a Docker Image

24 December 2025bpd · ubuntu

Packaging Your Application for Deployment

The ‘Ubuntu System Administration Guide’ starts to build a basic CI/CD (Continuous Integration/Continuous Deployment) pipeline. The very first step in any modern deployment workflow is to package your application into a Docker image.

The Build and Push Process

The guide demonstrates a simple project with a static HTML page. This project includes:

  1. A `Dockerfile`: This defines how to build the image, typically starting from a base image (like `nginx`) and copying the application code into it.
  2. A `build.sh` script: This script automates the two key commands: `docker build` and `docker push`.

The script takes a version number as an argument, tags the image with that version, and then pushes it to a container registry like Docker Hub. This creates a versioned, immutable artifact of your application that is ready to be deployed to any environment.


This post is based from content of the book Ubuntu System adminstration guide. And the book can be found here https://www.amazon.com/stores/Mattias-Hemmingsson/author/B0FF5CQX13