Update docker base image #517
Workflow file for this run
This file contains 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: Update docker base image | |
concurrency: | |
group: base-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
## Build base images to be used by other github workflows | |
jobs: | |
base: | |
runs-on: ${{ github.repository_owner == 'emqx' && matrix.platform[2] || '["ubuntu-latest"]' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
base_image_vsn: | |
- "5.0" | |
platform: | |
- [ubuntu22.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [ubuntu22.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [ubuntu20.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [ubuntu20.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [ubuntu18.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [ubuntu18.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [ubuntu16.04, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [ubuntu16.04, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [debian12, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [debian12, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [debian11, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [debian11, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [debian10, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [debian10, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [debian9, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [debian9, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [el9, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [el9, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [el8, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [el8, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [el7, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [el7, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [amzn2, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [amzn2, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [amzn2023, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [amzn2023, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
- [alpine3.15.1, linux/amd64, [self-hosted, linux, x64, ephemeral]] | |
- [alpine3.15.1, linux/arm64, [self-hosted, linux, arm64, ephemeral]] | |
env: | |
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}/base-${{ matrix.base_image_vsn }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_DEFAULT_REGION }} | |
- name: Get cache | |
run: aws s3 sync s3://docker-buildx-cache/emqx-builder/${{ matrix.platform[0] }} /tmp/.docker-buildx-cache | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- uses: docker/metadata-action@v5 | |
id: base_meta | |
with: | |
images: ${{ env.REGISTRY_IMAGE }} | |
tags: type=raw,value=${{ matrix.platform[0] }} | |
- name: Build base image | |
uses: docker/build-push-action@v5 | |
with: | |
pull: true | |
cache-from: type=local,src=/tmp/.docker-buildx-cache,mode=max | |
cache-to: type=local,dest=/tmp/.docker-buildx-cache-new,mode=max | |
platforms: ${{ matrix.platform[1] }} | |
tags: ${{ steps.base_meta.outputs.tags }} | |
labels: ${{ steps.base_meta.outputs.labels }} | |
file: ${{ matrix.platform[0] }}/Dockerfile | |
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=false | |
context: . | |
- name: Update cache | |
run: aws s3 sync --delete /tmp/.docker-buildx-cache-new s3://docker-buildx-cache/emqx-builder/${{ matrix.platform[0] }} |