Skip to content

Publish distribution image to DockerHub as package-registry-distribution - #1808

Merged
teresaromero merged 3 commits into
elastic:mainfrom
teresaromero:retag-package-registry-distribution
Jul 3, 2026
Merged

Publish distribution image to DockerHub as package-registry-distribution#1808
teresaromero merged 3 commits into
elastic:mainfrom
teresaromero:retag-package-registry-distribution

Conversation

@teresaromero

Copy link
Copy Markdown
Contributor

Summary

  • Retag the internal docker.elastic.co/package-registry/distribution image as package-registry/package-registry-distribution (same digest) so it can be published under a non-misleading name.
  • Update the DockerHub copy step to publish as elastic/package-registry-distribution instead of elastic/distribution.

Related issue

Related to elastic/platform-engineering-productivity#2953, which tracks deleting the old elastic/distribution image from DockerHub once this is live.

Follow-up of #1692, which added the DockerHub copy step and introduced the elastic/distribution name.

elastic/distribution on DockerHub is a misleading name since the copy
pipeline strips the upstream namespace. Retag the internal
docker.elastic.co image as package-registry-distribution alongside the
existing distribution tag, and copy the renamed image to DockerHub so
it publishes as elastic/package-registry-distribution.

See elastic/platform-engineering-productivity#2953.
@teresaromero
teresaromero requested a review from a team as a code owner July 3, 2026 07:51
Comment thread .buildkite/release-package-registry-distribution.yml Outdated
if: "build.source == 'ui' || build.env('BUILDKITE_TRIGGERED_FROM_BUILD_PIPELINE_SLUG') == 'fleet-server'"
command: |
set -euo pipefail

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the previous step, the script manages the case of the environment variable DRY_RUN being true to skip the publication.

Here we should do the same to keep consistency.

What about adding this ?

DRY_RUN="$$(buildkite-agent meta-data get DRY_RUN --default="${DRY_RUN:-"false"}")"
if [[ "$${DRY_RUN:-"false"} == "true" ]]; then
    echo "Skip triggering steps to release images to Docker Hub"
    exit 0
fi

In case we want to trigger this step from the UI in DRY_RUN true mode.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be moved to another pull request.

what I'm thinking is to add another input item

  - input: ":truffleruby: Input version for docker tag"
    key: input
    if: "build.source == 'ui'"
    fields:
      - text: "The docker tag to be published (format: major.minor.patch(-prerelease)?)."
        hint: "e.g. 0.0.1"
        key: "DOCKER_TAG"
        required: true
      - text: "DRY_RUN."
        key: DRY_RUN
        options:
          - label: "True"
            value: "true"
          - label: "False"
            value: "false"
        default: "true"

Then remove the hard-coded value for DRY_RUN from the env key in the pipeline definition:

And update the script for that to include the retrieval of that variable

DRY_RUN="$(buildkite-agent meta-data get DRY_RUN --default="${DRY_RUN:-"false"}")"
if [[ "${DRY_RUN:-"false"} == "true" ]]; then
    echo "Skip triggering steps to release images to Docker Hub"
    exit 0
fi

So, if the pipeline is triggered from another pipeline (using a trigger step) by default DRY_RUN will get the value false if not defined.

When triggered using the UI, by default will be true this variable (from the input step). Values filled from the input step are retrieved from the meta-data.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've added the DRY_RUN guard, i think the other should be part of a dedicated PR as a followup improvement

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

followup #1809

Rename the "Copy release images to Docker Hub" step's label/key to
clarify it only triggers the downstream copy pipeline steps, and skip
triggering them when DRY_RUN is true, for consistency with the
existing DRY_RUN handling in publish-distribution.sh.
Comment thread .buildkite/release-package-registry-distribution.yml Outdated
Co-authored-by: Mario Rodriguez Molins <marrodmo@gmail.com>
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@mrodm mrodm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@mergify

mergify Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request
@teresaromero
teresaromero merged commit 0bb7a6d into elastic:main Jul 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants