chore: Cherry-picked changes from upstream #749
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 10 * * *' | |
| push: | |
| branches: | |
| - 'main' | |
| - 'releases/v*' | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| env: | |
| DOCKER_VERSION: v27.3.1 | |
| DOCKER_BUILD_SUMMARY: false | |
| jobs: | |
| main: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| version: | |
| - "" | |
| - v27.3.1 | |
| - type=image,tag=27.3.1 | |
| include: | |
| - os: macos-13 | |
| version: v27.3.1 | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
| with: | |
| egress-policy: audit | |
| - | |
| name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: ${{ matrix.version }} | |
| channel: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 | |
| - windows-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
| with: | |
| egress-policy: audit | |
| - | |
| name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: ${{ env.DOCKER_VERSION }} | |
| channel: test | |
| daemon-config: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 | |
| - windows-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
| with: | |
| egress-policy: audit | |
| - | |
| name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| daemon-config: | | |
| { | |
| "debug": true, | |
| "features": { | |
| "containerd-snapshotter": true | |
| } | |
| } | |
| context: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 | |
| - macos-13 | |
| - windows-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
| with: | |
| egress-policy: audit | |
| - | |
| name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: ${{ env.DOCKER_VERSION }} | |
| context: foo | |
| - | |
| name: Check context | |
| run: | | |
| docker context inspect foo | |
| lima-start-args: | |
| #runs-on: macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 | |
| runs-on: macos-13 | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
| with: | |
| egress-policy: audit | |
| - | |
| name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: ${{ env.DOCKER_VERSION }} | |
| env: | |
| LIMA_START_ARGS: --cpus 4 --memory 8 | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| containerd: | |
| - containerd-system | |
| - containerd-tarball | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
| with: | |
| egress-policy: audit | |
| - | |
| name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - | |
| name: Uninstall containerd | |
| if: matrix.containerd == 'containerd-tarball' | |
| run: | | |
| sudo apt-get remove -y containerd.io | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: ${{ env.DOCKER_VERSION }} | |
| - | |
| name: Start registry | |
| run: | | |
| docker run -d -p 5000:5000 --restart=always --name registry registry:2 | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | |
| with: | |
| driver: docker | |
| driver-opts: network=host | |
| - | |
| name: Build and push | |
| uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 | |
| with: | |
| context: ./test | |
| push: true | |
| tags: | | |
| localhost:5000/name/app:latest | |
| - | |
| name: Inspect | |
| run: | | |
| docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}' | |
| build-macos: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 | |
| - macos-13 | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
| with: | |
| egress-policy: audit | |
| - | |
| name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: ${{ env.DOCKER_VERSION }} | |
| - | |
| name: Start registry | |
| run: | | |
| docker run -d -p 5000:5000 --restart=always --name registry registry:2 | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | |
| with: | |
| driver: docker | |
| driver-opts: network=host | |
| - | |
| name: Build and push | |
| uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0 | |
| with: | |
| context: ./test | |
| push: true | |
| tags: | | |
| localhost:5000/name/app:latest | |
| - | |
| name: Inspect | |
| run: | | |
| docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}' | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
| with: | |
| egress-policy: audit | |
| - | |
| name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: ${{ env.DOCKER_VERSION }} | |
| - | |
| name: Build | |
| working-directory: ./test | |
| run: | | |
| docker build -f win.Dockerfile -t test . | |
| - | |
| name: Inspect | |
| run: | | |
| docker image inspect test | |
| set-host: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
| with: | |
| egress-policy: audit | |
| - | |
| name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: ${{ env.DOCKER_VERSION }} | |
| set-host: true | |
| - | |
| name: List contexts | |
| run: | | |
| docker context ls | |
| rootless: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | |
| with: | |
| egress-policy: audit | |
| - | |
| name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: ${{ env.DOCKER_VERSION }} | |
| rootless: true | |
| - | |
| name: List contexts | |
| run: | | |
| docker context ls | |
| tcp: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 | |
| - macos-13 | |
| - windows-latest | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v4 | |
| - | |
| name: Set up Docker | |
| id: setup_docker | |
| uses: ./ | |
| with: | |
| version: ${{ env.DOCKER_VERSION }} | |
| tcp-port: 2378 | |
| - | |
| name: Check docker info through TCP | |
| run: | | |
| docker info | |
| env: | |
| DOCKER_HOST: ${{ steps.setup_docker.outputs.tcp }} | |
| undock-regctl-version: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| undock_version: | |
| - '' | |
| - v0.9.0 | |
| regctl_version: | |
| - '' | |
| - v0.8.2 | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v5 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: type=image | |
| env: | |
| UNDOCK_VERSION: ${{ matrix.undock_version }} | |
| REGCTL_VERSION: ${{ matrix.regctl_version }} | |
| docker-29: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-13 | |
| - windows-latest | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v5 | |
| - | |
| name: Set up Docker | |
| uses: ./ | |
| with: | |
| version: v29.0.0-rc.1 | |
| channel: test |