add builx cache-from registry
This commit is contained in:
parent
9c89e8d4d1
commit
8ecf2e1cac
|
@ -1,3 +1,4 @@
|
|||
.git*
|
||||
.dockerignore
|
||||
Dockerfile
|
||||
Dockerfile
|
||||
Justfile
|
|
@ -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 }}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
20
Justfile
20
Justfile
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue