Skip to content

Support pull-through caches #282

Closed
Closed
@wichert

Description

@wichert

Troubleshooting

Before sumbitting a bug report please read the Troubleshooting doc.

Behaviour

Steps to reproduce this issue

  1. Setup a GitHub Action workflow using docker/build-action
  2. Observe hitting a pull rate limit

Expected behaviour

Be able to use an existing Artifactory instance as a pull-through cache.

Actual behaviour

No cache ability, causing us to hit rate limits.

jobs:
  python:
    runs-on: self-hosted

    name: Build Python ${{ matrix.python }}

    strategy:
      matrix:
        python: ["3.8", "3.9"]

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Set up Docker Buildx
        uses: synced-actions/docker-setup-buildx-action@v1

      - name: Login to Artifactory
        uses: synced-actions/docker-login-action@v1
        with:
          registry: docker.artifactory.tri-ad.tech
          username: ${{ secrets.ARTIFACTORY_USER }}
          password: ${{ secrets.ARTIFACTORY_API_KEY }}

      - name: Build and push
        uses: synced-actions/docker-build-push-action@v2
        with:
          cache-from: type=registry,ref=user/app:latest
          push: true
          tags: repository/python-ci:${{ matrix.python }}
          context: ./python-ci
          file: ./python-ci/Dockerfile
          build-args: |
            PYTHON_VERSION=${{ matrix.python }}

Please note that synced-actions/docker-login-action and synced-actions/docker-build-push-action are synced copies of the official actions, running on a GHE instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions