Push Docker image

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

Image loading...Example 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:

Image loading...Selecting 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.

Image loading...Configuring wildcard in Buddy pipeline

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

Image loading...List 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:

Image loading...Docker 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:

Image loading...Selecting 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_RUN_TAG variable to automatically tag the images with the tags created in your repository, one of default environment variables you can use. Image loading...Tagging Docker image

Last modified on Oct 29, 2024

Recommended