add builx cache-from registry
Docker / build-push (rust) (push) Has been cancelled Details
Docker / build-push (base) (push) Failing after 32m20s Details
Docker / build-push (docker) (push) Failing after 37m43s Details

This commit is contained in:
DataHearth 2023-06-24 15:08:05 +02:00
parent 9c89e8d4d1
commit 8ecf2e1cac
No known key found for this signature in database
GPG Key ID: E88FD356ACC5F3C4
4 changed files with 17 additions and 15 deletions

View File

@ -1,3 +1,4 @@
.git*
.dockerignore
Dockerfile
Dockerfile
Justfile

View File

@ -43,9 +43,8 @@ jobs:
with:
push: true
target: ${{ matrix.target }}
build-args: |
BUILDKIT_INLINE_CACHE=1
cache-from: type=registry,ref=${{ env.REPOSITORY }}:${{ matrix.target }}
cache-to: type=registry,ref=${{ env.REPOSITORY }}:${{ matrix.target }}-cache,mode=max
cache-from: type=registry,ref=${{ env.REPOSITORY }}:${{ matrix.target }}-cache
tags: |
${{ env.REPOSITORY }}:${{ matrix.target }}
${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ matrix.target }}

View File

@ -2,8 +2,10 @@ FROM debian:bookworm-slim AS base
RUN apt-get update
RUN apt-get install -y git curl
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs git curl
RUN apt-get install -y nodejs
FROM base AS docker

View File

@ -10,30 +10,30 @@ alias ba := build-all
alias pa := push-all
build TARGET:
@docker build -t datahearth/act_runner:{{TARGET}} \
@docker buildx build --push -t {{base_img_name}}:{{TARGET}} \
--target {{TARGET}} \
--cache-to type=inline \
--cache-from type=registry,ref=datahearth/act_runner:{{TARGET}} .
@docker tag datahearth/act_runner:{{TARGET}} {{gitea_img_name}}:{{TARGET}}
--cache-to type=registry,ref={{base_img_name}}:{{TARGET}}-cache,mode=max \
--cache-from type=registry,ref={{base_img_name}}:{{TARGET}}-cache .
@docker tag {{base_img_name}}:{{TARGET}} {{gitea_img_name}}:{{TARGET}}
push TARGET: (build TARGET)
@docker push datahearth/act_runner:{{TARGET}}
@docker push {{gitea_img_name}}:{{TARGET}}
build-all:
#!/usr/local/bin/zsh
#!/usr/bin/env zsh
for target in {{all_targets}}; do
echo "Building $target";
docker build -t datahearth/act_runner:$target \
docker buildx build --push -t {{base_img_name}}:$target \
--target $target \
--cache-to type=inline \
--cache-from type=registry,ref=datahearth/act_runner:$target .;
--cache-to type=registry,ref={{base_img_name}}:$target-cache,mode=max \
--cache-from type=registry,ref={{base_img_name}}:$target-cache .;
docker tag datahearth/act_runner:$target {{gitea_img_name}}:$target;
docker tag {{base_img_name}}:$target {{gitea_img_name}}:$target;
done
push-all: build-all
#!/usr/local/bin/zsh
#!/usr/bin/env zsh
for target in {{all_targets}}; do
echo "Pushing $target";
docker push datahearth/act_runner:$target;