diff --git a/.github/workflows/build-and-push-images.yml b/.github/workflows/build-and-push-images.yml index 58acb3e..c8551e3 100644 --- a/.github/workflows/build-and-push-images.yml +++ b/.github/workflows/build-and-push-images.yml @@ -21,6 +21,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Log in to DockerHub uses: docker/login-action@v1 with: @@ -35,3 +41,6 @@ jobs: tags: ${{ github.repository }}:${{ matrix.postgres }} build-args: | ALPINE_VERSION=${{ matrix.alpine }} + platforms: | + linux/amd64 + linux/arm64 diff --git a/Dockerfile b/Dockerfile index 8738374..f06e4fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ ARG ALPINE_VERSION FROM alpine:${ALPINE_VERSION} +ARG TARGETARCH ADD src/install.sh install.sh RUN sh install.sh && rm install.sh diff --git a/README.md b/README.md index 0e60774..8adc088 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ docker exec sh restore.sh ## Build the image locally `ALPINE_VERSION` determines Postgres version compatibility. See [`build-and-push-images.yml`](.github/workflows/build-and-push-images.yml) for the latest mapping. ```sh -docker build --build-arg ALPINE_VERSION=3.14 +DOCKER_BUILDKIT=1 docker build --build-arg ALPINE_VERSION=3.14 . ``` ## Run a simple test environment with Docker Compose ```sh diff --git a/src/install.sh b/src/install.sh index 9e683f3..d25fe05 100644 --- a/src/install.sh +++ b/src/install.sh @@ -17,7 +17,10 @@ pip3 install awscli # install go-cron apk add curl -curl -L https://github.com/odise/go-cron/releases/download/v0.0.6/go-cron-linux.gz | zcat > /usr/local/bin/go-cron +curl -L https://github.com/ivoronin/go-cron/releases/download/v0.0.5/go-cron_0.0.5_linux_${TARGETARCH}.tar.gz -O +tar xvf go-cron_0.0.5_linux_${TARGETARCH}.tar.gz +rm go-cron_0.0.5_linux_${TARGETARCH}.tar.gz +mv go-cron /usr/local/bin/go-cron chmod u+x /usr/local/bin/go-cron apk del curl