Skip to content

Commit

Permalink
adding layers
Browse files Browse the repository at this point in the history
  • Loading branch information
usrbinkat committed Feb 3, 2024
1 parent 387f563 commit 0be4cbd
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/docker/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ENV apt_update="sudo apt-get update"
ENV apt_install="TERM=linux DEBIAN_FRONTEND=noninteractive sudo apt-get install -q --yes --purge --assume-yes --auto-remove --allow-downgrades -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold'"
ENV apt_clean="sudo apt-get clean && sudo apt-get autoremove -y && sudo apt-get purge -y --auto-remove"
ENV curl="/usr/bin/curl --silent --show-error --tlsv1.2 --location"
ENV curl_github="/usr/bin/curl --silent --show-error --tlsv1.2 --request GET --header \"Authorization: Bearer $GITHUB_TOKEN\" --header \"X-GitHub-Api-Version: 2022-11-28\" --url --location"
ENV curl_github="/usr/bin/curl --silent --show-error --tlsv1.2 --request GET --url --location"
ENV dir_clean="\
sudo rm -rf \
/var/lib/{apt,cache,log} \
Expand Down
122 changes: 87 additions & 35 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,95 +72,147 @@ jobs:

- name: Build and Push Image pulumi/devcontainer:slim
uses: docker/build-push-action@v5
id: docker-build-push-slim
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache,mode=max
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-cache,mode=max
context: .github/docker/slim
file: .github/docker/slim/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

- name: Build and Push Image pulumi/devcontainer:slim-node
uses: docker/build-push-action@v5
id: docker-build-push-slim-node
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-node-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache,mode=max
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-node-cache
context: .github/docker/slim-node
file: .github/docker/slim-node/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-node,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

- name: Build and Push Image pulumi/devcontainer:hugo
- name: Build and Push Image pulumi/devcontainer:slim-python
uses: docker/build-push-action@v5
id: docker-build-push-hugo
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-node-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:hugo-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache,mode=max
context: .github/docker/hugo
file: .github/docker/hugo/Dockerfile
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-python-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-python-cache
context: .github/docker/slim-python
file: .github/docker/slim-python/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:hugo,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-python,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

- name: Build and Push Image pulumi/devcontainer:slim-python
- name: Build and Push Image pulumi/devcontainer:slim-golang
uses: docker/build-push-action@v5
id: docker-build-push-slim-python
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-python-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache,mode=max
context: .github/docker/slim-python
file: .github/docker/slim-python/Dockerfile
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-golang-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-golang-cache
context: .github/docker/slim-golang
file: .github/docker/slim-golang/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-python,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-dotnet,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

- name: Build and Push Image pulumi/devcontainer:slim-dotnet
uses: docker/build-push-action@v5
id: docker-build-push-slim-dotnet
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-dotnet-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache,mode=max
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-dotnet-cache
context: .github/docker/slim-dotnet
file: .github/docker/slim-dotnet/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-dotnet,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

- name: Build and Push Image pulumi/devcontainer:slim-golang
- name: Build and Push Image pulumi/devcontainer:slim-all
uses: docker/build-push-action@v5
id: docker-build-push-slim-golang
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-cache
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-golang-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:build-cache,mode=max
context: .github/docker/slim-golang
file: .github/docker/slim-golang/Dockerfile
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-all-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-all-cache,mode=max
context: .github/docker/slim-all
file: .github/docker/slim-all/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-all,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

- name: Build and Push Image pulumi/devcontainer:hugo
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:hugo-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:hugo-cache,mode=max
context: .github/docker/hugo
file: .github/docker/hugo/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:hugo,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

- name: Build and Push Image pulumi/devcontainer:base
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:base-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:base-cache,mode=max
context: .github/docker/base
file: .github/docker/base/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:base,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

- name: Build and Push Image pulumi/devcontainer:dind
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:dind-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:dind-cache,mode=max
context: .github/docker/docker-in-docker
file: .github/docker/docker-in-docker/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:dind,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

- name: Build and Push Image pulumi/devcontainer:extra
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:extra-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:extra-cache,mode=max
context: .github/docker/extra
file: .github/docker/extra/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:extra,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

- name: Build and Push Image pulumi/devcontainer:code-server
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
with:
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
cache-from: |
type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:code-server-cache
cache-to: type=registry,ref=ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:code-server-cache,mode=max
context: .github/docker/code-server
file: .github/docker/code-server/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:slim-golang,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"
tags: "ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:code-server,ghcr.io/${{ steps.string-repository-to-lower.outputs.lowercase }}:${{ github.sha }}"

0 comments on commit 0be4cbd

Please sign in to comment.