Skip to content

Update docker base image #773

Update docker base image

Update docker base image #773

name: Update docker base image
## Update the base image every day
on:
workflow_dispatch:
schedule:
## In UTC
- cron: '0 0 * * *'
## Build base images to be used by other github workflows
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'lf-edge/ekuiper'
strategy:
fail-fast: false
matrix:
os:
- debian
- centos
- alpine
golang:
- 1.20.2
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:latest
platforms: all
- uses: actions/cache@v3
with:
path: /tmp/.docker-buildx-cache
key: docker-buildx-${{ matrix.golang }}-${{ matrix.os }}
- name: Docker login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/build-push-action@v4
if: matrix.os == 'centos'
with:
push: true
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: linux/amd64,linux/arm64
build-args: GO_VERSION=${{ matrix.golang }}
tags: ghcr.io/${{ github.repository }}/base:${{ matrix.golang }}-${{ matrix.os }}
file: .github/dockerfile/Dockerfile.${{ matrix.os }}
- uses: docker/build-push-action@v4
if: matrix.os == 'debian'
with:
push: true
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: linux/amd64,linux/arm64,linux/arm/v7
build-args: GO_VERSION=${{ matrix.golang }}
tags: ghcr.io/${{ github.repository }}/base:${{ matrix.golang }}-${{ matrix.os }}
file: .github/dockerfile/Dockerfile.${{ matrix.os }}
- uses: docker/build-push-action@v4
if: matrix.os == 'alpine'
with:
push: true
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: linux/amd64,linux/arm64,linux/arm/v7
build-args: GO_VERSION=${{ matrix.golang }}
tags: ghcr.io/${{ github.repository }}/base:${{ matrix.golang }}-${{ matrix.os }}
file: .github/dockerfile/Dockerfile.${{ matrix.os }}
- name: Update cache
run: |
rm -rf /tmp/.docker-buildx-cache
mv /tmp/.docker-buildx-cache-new /tmp/.docker-buildx-cache