From cbbe89bb8b509acee8f18576d7a08494320a9d96 Mon Sep 17 00:00:00 2001 From: Kat Morgan Date: Mon, 22 Jan 2024 21:28:53 +0000 Subject: [PATCH] enable docker by default until other opts are ready for prime time --- .github/workflows/container.yaml | 38 +++++++++++++++++++++++--------- devcontainer.json | 4 ++++ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml index cc34d45..9869053 100644 --- a/.github/workflows/container.yaml +++ b/.github/workflows/container.yaml @@ -83,36 +83,52 @@ jobs: uses: docker/build-push-action@v5 with: push: false - cache-from: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:latest - cache-to: type=inline + cache-from: | + type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:build-cache + type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:latest + cache-to: type=inline,mode=max context: ./docker file: ./docker/Dockerfile platforms: linux/amd64,linux/arm64 tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}" - + - name: Push Container Image if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: docker/build-push-action@v5 with: push: true - cache-from: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:latest - cache-to: type=inline + cache-from: | + type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:build-cache + type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:latest + cache-to: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:build-cache,mode=max context: ./docker file: ./docker/Dockerfile platforms: linux/amd64,linux/arm64 tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}" # - -# if: ${{ github.event_name == 'push' }} && ${{ github.ref == 'refs/heads/main' }} -# name: Container Build & Push +# name: Build Container Image +# if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main') # uses: docker/build-push-action@v5 -# id: container-push # with: -# push: true -# cache-from: type=inline +# push: false +# cache-from: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:latest +# cache-to: type=inline # context: ./docker # file: ./docker/Dockerfile # platforms: linux/amd64,linux/arm64 -# annotations: '"annotations": { "org.opencontainers.image.description": "Pulumi Devcontainer" }' # tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}" +# +# - +# name: Push Container Image +# if: github.event_name == 'push' && github.ref == 'refs/heads/main' +# uses: docker/build-push-action@v5 +# with: +# push: true +# cache-from: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:latest +# cache-to: type=inline +# context: ./docker +# file: ./docker/Dockerfile +# platforms: linux/amd64,linux/arm64 +# tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}" \ No newline at end of file diff --git a/devcontainer.json b/devcontainer.json index 698922e..4965b35 100644 --- a/devcontainer.json +++ b/devcontainer.json @@ -68,6 +68,10 @@ ] } }, + "features": { + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {} + }, + "mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"], "remoteUser": "vscode", "overrideCommand": false, "runArgs": ["--init", "--privileged", "--network=host"],