Docker Build and Release Processes

Build Process

The Dockerfile within the repository is used to build the Docker image for each credential helper. It’s located at Dockerfile.

The Dockerfile utilizes the golang base image and installs the Go compiler and the necessary dependencies.

Building Docker Images

To build the Docker images, run the following command from the root directory of the repository:

docker build -t docker/credential-helpers:<tag> . 
          
  • Replace <tag> with the desired tag for the image, for example, latest.
  • The . at the end of the command indicates the current directory, which contains the Dockerfile.

Release Process

The release process is designed to automate the building and pushing of Docker images to the Docker Hub repository. It leverages the following tools:

Release Workflow

The release workflow on GitHub Actions triggers when a new tag is created on the master branch of the repository. This workflow performs the following steps:

  1. Builds the Docker image: This step utilizes the Dockerfile to build the Docker image for the specific tag.
  2. Pushes the image to Docker Hub: The built image is pushed to the Docker Hub repository, using the provided tag.

Release Options

The release process can be customized by utilizing different options available in the GitHub Actions workflow:

  • Release tag: The workflow automatically uses the tag that triggered the release.
  • Build context: The workflow uses the default build context, which is the root directory of the repository.
  • Docker Hub credentials: The workflow uses the configured Docker Hub credentials stored as secrets in the repository.

Examples

Here are some examples of how to trigger and customize the release process:

  1. Creating a new release:

    • Command: git tag -a v1.0.0 -m "Release v1.0.0"
    • Description: This command creates a new tag v1.0.0 on the master branch. The workflow will automatically trigger and build the image for this tag and push it to Docker Hub.
  2. Customizing the release tag:

    • Command: git tag -a v1.0.0-alpha -m "Release v1.0.0 alpha"
    • Description: This command creates a new tag v1.0.0-alpha on the master branch. The workflow will build the image with this tag and push it to Docker Hub.
  3. Using a specific build context:

    • Command: (modify the workflow configuration to use a specific build context)
    • Description: This example is not applicable as the current workflow does not provide options for changing the build context. The workflow will use the root directory of the repository as the build context.