Push Docker image

In this guide we show how to automatically push built Docker images to the selected Docker registry.

Example pipeline with multiple push actionsExample pipeline with multiple push actions

Configuration

Success
The example below shows how to configure a pipeline which only pushes tagged Docker images.
  1. Select your Git provider (GitHub, Bitbucket, GitLab, or private) and the repository from which Buddy should fetch the code:

Selecting repository with source code for Docker imageSelecting repository with source code for Docker image

  1. Add a new pipeline and set the trigger mode to On eventsGit push.
  2. Set the code scope to Wildcard and customize the refs/tags pattern according to your workflow.

Setting the pattern to refs/tags/v* will only deploy the tags starting with v: v1, v1.1, v2, and so on.

Configuring wildcard in Buddy pipeline Configuring wildcard in Buddy pipeline

  1. Next, add the Build Image action that will create the image using the instructions from your Dockerfile:

List of Docker actions in BuddyList of Docker actions in Buddy

  1. Now, it's time to add the Push Image action that will release your application to the selected registry:

Docker action configurationDocker action configuration

  1. The next step is selecting the registry. Buddy integrates with Docker Hub, Amazon ECR, Google GCR, and Google Artifact Registry. You can also use a private registry, if you develop Docker internally:

Selecting Docker registrySelecting Docker registry

  1. Finally, determine the URL to the image in the registry and the tag with which it will be pushed.
Hint
You can use the $BUDDY_EXECUTION_TAG variable to automatically tag the images with the tags created in your repository, one of default environment variables you can use. Tagging Docker imageTagging Docker image
Recommended
Last update:
Sep 19, 2024