Skip to content

Refactor Dockerfiles to use ARG for base images and add ACR sync work…#4952

Open
maxmartin-cgi wants to merge 8 commits into
mainfrom
maxmartin-cgi/utilise-acr-for-docker-pulls
Open

Refactor Dockerfiles to use ARG for base images and add ACR sync work…#4952
maxmartin-cgi wants to merge 8 commits into
mainfrom
maxmartin-cgi/utilise-acr-for-docker-pulls

Conversation

@maxmartin-cgi

Copy link
Copy Markdown
Collaborator

…flow

Resolves #4917

What is being addressed

Pipeline runs fail with a 429: TOOMANYREQUESTS error whenever we hit rate limits on Docker Hub. This blocks all development and CICD pipeline runs until that limit expires. Here's an example.

How is this addressed

  • Update Dockerfiles to use parameterised image sources, build scripts now use ACR_BASE_IMAGE_PREFIX to grab from ACR if image is available.
  • Added github action to update ACR images.
  • Updated docs to reflect new parameter.

Copilot AI review requested due to automatic review settings July 10, 2026 09:32
@maxmartin-cgi maxmartin-cgi requested a review from a team as a code owner July 10, 2026 09:32
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

Unit Test Results

744 tests   744 ✅  9s ⏱️
  9 suites    0 💤
  9 files      0 ❌

Results for commit 593e48f.

♻️ This comment has been updated with latest results.

Copilot AI 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.

Pull request overview

This PR reduces CI/CD failures caused by Docker Hub rate limiting by enabling Docker builds to optionally pull common base images from an Azure Container Registry (ACR) mirror instead of directly from Docker Hub.

Changes:

  • Refactors multiple Dockerfiles to parameterize their base images via ARG, enabling base image source overrides at build time.
  • Updates the Docker image build GitHub Actions workflow to pass base-image build args derived from the ACR_BASE_IMAGE_PREFIX variable.
  • Adds a new scheduled/manual GitHub Actions workflow to sync (mirror) selected upstream base images into ACR, and documents the new configuration.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
templates/workspace_services/guacamole/guacamole-server/docker/Dockerfile Parameterizes Maven + guacd base images via ARG for ACR mirroring.
templates/workspace_services/gitea/docker/Dockerfile Parameterizes the upstream Gitea base image repo via ARG.
templates/shared_services/gitea/docker/Dockerfile Parameterizes the upstream Gitea base image repo via ARG.
resource_processor/vmss_porter/Dockerfile Parameterizes Python base image via ARG.
api_app/Dockerfile Parameterizes Python base image via ARG.
.github/workflows/build_docker_images.yml Passes build args to select builds so they can use mirrored base images when configured.
.github/workflows/sync_acr_base_images.yml New workflow to periodically import selected upstream base images into ACR.
docs/tre-admins/setup-instructions/workflows.md Documents ACR_BASE_IMAGE_PREFIX and the new ACR base image sync workflow.
docs/tre-admins/setup-instructions/cicd-pre-deployment-steps.md Documents ACR_BASE_IMAGE_PREFIX and the new ACR base image sync workflow.

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
persist-credentials: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
fi

- name: Azure Login
uses: azure/login@v3
@maxmartin-cgi

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/29093980082 (with refid 6c21e03a)

(in response to this comment from @maxmartin-cgi)

@maxmartin-cgi maxmartin-cgi added workflows GitHub workflows (CI/CD) github_actions Pull requests that update GitHub Actions code labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code workflows GitHub workflows (CI/CD)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reexamine Docker Hub image pulls and leverage ACR as cache

2 participants