Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
enable docker by default until other opts are ready for prime time
Browse files Browse the repository at this point in the history
  • Loading branch information
usrbinkat authored Jan 22, 2024
1 parent 3feba0d commit cbbe89b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
38 changes: 27 additions & 11 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
4 changes: 4 additions & 0 deletions devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit cbbe89b

Please sign in to comment.