Add an image tarball output that later jobs can load and test

Đang mở
#351 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, github-actions
Lĩnh vực
ci-cd

Hướng nghiên cứu

Start with bake.yml and build.yml, which currently accept only image or local for output, and trace how output: local combines with artifact-upload to produce and upload a filesystem export. Follow the same path for the docker exporter, ensuring each matrix runner uploads its own platform tarball as an artifact. Done means a caller can set output: docker and artifact-upload: true, download the matching artifact, and run docker load --input image.tar in a later job.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I use bake.yml to build 36 images in https://github.com/home-operations/containers. On each pull request, I want to run integration tests against the built image. The tests start the image as a container on an amd64 runner and on an arm64 runner.

bake.yml and build.yml accept only image or local for output. The build runs in jobs inside the reusable workflow. The image is not in the Docker image store of any caller job, so a test job can only pull it from a registry.

To test a pull request today, I must push the image to a scratch repository and test it by digest. A scratch repository is a registry repository that only holds test images. This has three costs:

  • Pull request runs need packages: write and registry credentials.
  • The scratch repository grows, and I must delete old versions myself.
  • Pull requests from forks cannot push, so they cannot run the tests.

I want an output that exports the image with the docker exporter and uploads the tarball as a GitHub artifact. When distribute is true, each runner builds one platform, so each runner can upload one tarball. output: local with artifact-upload already does this for a filesystem export.

A test job on the matching runner can then download the artifact, run docker load, and test the image. The test job does not need a registry or push credentials.

The example below shows the idea. output: docker and the artifact name are not real values.

jobs:
  build:
    uses: docker/github-builder/.github/workflows/bake.yml@v1
    with:
      output: docker
      artifact-upload: true

  test:
    needs: build
    strategy:
      matrix:
        arch: [amd64, arm64]
    runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-26.04-arm' || 'ubuntu-26.04' }}
    steps:
      - uses: actions/checkout@v7
      - uses: actions/download-artifact@v8
        with:
          name: docker-github-builder-assets-linux-${{ matrix.arch }}
      - run: docker load --input image.tar
      - run: make test
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
94
Fork
28
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
20

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của docker/github-builder

Tất cả issue của docker/github-builder

Issue tương tự

Thêm issue về DevOps

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.