mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 11:38:38 +00:00
CI: cache Docker builds in workflows
This commit is contained in:
8
.github/workflows/docker-release.yml
vendored
8
.github/workflows/docker-release.yml
vendored
@@ -109,6 +109,8 @@ jobs:
|
|||||||
labels: ${{ steps.labels.outputs.value }}
|
labels: ${{ steps.labels.outputs.value }}
|
||||||
provenance: false
|
provenance: false
|
||||||
push: true
|
push: true
|
||||||
|
cache-from: type=gha,scope=docker-release-amd64
|
||||||
|
cache-to: type=gha,mode=max,scope=docker-release-amd64
|
||||||
|
|
||||||
- name: Build and push amd64 slim image
|
- name: Build and push amd64 slim image
|
||||||
id: build-slim
|
id: build-slim
|
||||||
@@ -122,6 +124,8 @@ jobs:
|
|||||||
labels: ${{ steps.labels.outputs.value }}
|
labels: ${{ steps.labels.outputs.value }}
|
||||||
provenance: false
|
provenance: false
|
||||||
push: true
|
push: true
|
||||||
|
cache-from: type=gha,scope=docker-release-amd64
|
||||||
|
cache-to: type=gha,mode=max,scope=docker-release-amd64
|
||||||
|
|
||||||
# Build arm64 images (default + slim share the build stage cache)
|
# Build arm64 images (default + slim share the build stage cache)
|
||||||
build-arm64:
|
build-arm64:
|
||||||
@@ -210,6 +214,8 @@ jobs:
|
|||||||
labels: ${{ steps.labels.outputs.value }}
|
labels: ${{ steps.labels.outputs.value }}
|
||||||
provenance: false
|
provenance: false
|
||||||
push: true
|
push: true
|
||||||
|
cache-from: type=gha,scope=docker-release-arm64
|
||||||
|
cache-to: type=gha,mode=max,scope=docker-release-arm64
|
||||||
|
|
||||||
- name: Build and push arm64 slim image
|
- name: Build and push arm64 slim image
|
||||||
id: build-slim
|
id: build-slim
|
||||||
@@ -223,6 +229,8 @@ jobs:
|
|||||||
labels: ${{ steps.labels.outputs.value }}
|
labels: ${{ steps.labels.outputs.value }}
|
||||||
provenance: false
|
provenance: false
|
||||||
push: true
|
push: true
|
||||||
|
cache-from: type=gha,scope=docker-release-arm64
|
||||||
|
cache-to: type=gha,mode=max,scope=docker-release-arm64
|
||||||
|
|
||||||
# Create multi-platform manifests
|
# Create multi-platform manifests
|
||||||
create-manifest:
|
create-manifest:
|
||||||
|
|||||||
28
.github/workflows/sandbox-common-smoke.yml
vendored
28
.github/workflows/sandbox-common-smoke.yml
vendored
@@ -34,7 +34,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
docker build -t openclaw-sandbox-smoke-base:bookworm-slim - <<'EOF'
|
docker buildx build \
|
||||||
|
--load \
|
||||||
|
--tag openclaw-sandbox-smoke-base:bookworm-slim \
|
||||||
|
--cache-from type=gha,scope=sandbox-common-smoke-base \
|
||||||
|
--cache-to type=gha,mode=max,scope=sandbox-common-smoke-base \
|
||||||
|
- <<'EOF'
|
||||||
FROM debian:bookworm-slim
|
FROM debian:bookworm-slim
|
||||||
RUN useradd --create-home --shell /bin/bash sandbox
|
RUN useradd --create-home --shell /bin/bash sandbox
|
||||||
USER sandbox
|
USER sandbox
|
||||||
@@ -46,14 +51,19 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
BASE_IMAGE="openclaw-sandbox-smoke-base:bookworm-slim" \
|
docker buildx build \
|
||||||
TARGET_IMAGE="openclaw-sandbox-common-smoke:bookworm-slim" \
|
--load \
|
||||||
PACKAGES="ca-certificates" \
|
--tag openclaw-sandbox-common-smoke:bookworm-slim \
|
||||||
INSTALL_PNPM=0 \
|
--file Dockerfile.sandbox-common \
|
||||||
INSTALL_BUN=0 \
|
--build-arg BASE_IMAGE=openclaw-sandbox-smoke-base:bookworm-slim \
|
||||||
INSTALL_BREW=0 \
|
--build-arg PACKAGES=ca-certificates \
|
||||||
FINAL_USER=sandbox \
|
--build-arg INSTALL_PNPM=0 \
|
||||||
scripts/sandbox-common-setup.sh
|
--build-arg INSTALL_BUN=0 \
|
||||||
|
--build-arg INSTALL_BREW=0 \
|
||||||
|
--build-arg FINAL_USER=sandbox \
|
||||||
|
--cache-from type=gha,scope=sandbox-common-smoke \
|
||||||
|
--cache-to type=gha,mode=max,scope=sandbox-common-smoke \
|
||||||
|
.
|
||||||
|
|
||||||
u="$(docker run --rm openclaw-sandbox-common-smoke:bookworm-slim sh -lc 'id -un')"
|
u="$(docker run --rm openclaw-sandbox-common-smoke:bookworm-slim sh -lc 'id -un')"
|
||||||
test "$u" = "sandbox"
|
test "$u" = "sandbox"
|
||||||
|
|||||||
Reference in New Issue
Block a user