Skip to content

Commit 72dddc0

Browse files
Try docker improvements
1 parent f65cc98 commit 72dddc0

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/docker-images.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ jobs:
139139
set -euxo pipefail
140140
docker buildx build \
141141
--platform linux/amd64 \
142+
--cache-from type=registry,ref="${{ needs.detect-changes.outputs.base_image }}:buildcache-base-amd64" \
143+
--cache-to type=registry,ref="${{ needs.detect-changes.outputs.base_image }}:buildcache-base-amd64",mode=max \
142144
--push \
143145
-t "${{ needs.detect-changes.outputs.base_image }}:base-${{ needs.detect-changes.outputs.base_hash }}-amd64" \
144146
-t "${{ needs.detect-changes.outputs.base_image }}:base-main-amd64" \
@@ -183,6 +185,8 @@ jobs:
183185
set -euxo pipefail
184186
docker buildx build \
185187
--platform linux/arm64 \
188+
--cache-from type=registry,ref="${{ needs.detect-changes.outputs.base_image }}:buildcache-base-arm64" \
189+
--cache-to type=registry,ref="${{ needs.detect-changes.outputs.base_image }}:buildcache-base-arm64",mode=max \
186190
--push \
187191
-t "${{ needs.detect-changes.outputs.base_image }}:base-${{ needs.detect-changes.outputs.base_hash }}-arm64" \
188192
-t "${{ needs.detect-changes.outputs.base_image }}:base-main-arm64" \
@@ -268,6 +272,8 @@ jobs:
268272
docker buildx build \
269273
--platform linux/amd64 \
270274
--build-arg BASE_IMAGE="${{ needs.detect-changes.outputs.base_image }}:base-${{ needs.detect-changes.outputs.base_hash }}-amd64" \
275+
--cache-from type=registry,ref="${{ needs.detect-changes.outputs.sdk_image }}:buildcache-sdk-amd64" \
276+
--cache-to type=registry,ref="${{ needs.detect-changes.outputs.sdk_image }}:buildcache-sdk-amd64",mode=max \
271277
--push \
272278
-t "${{ needs.detect-changes.outputs.sdk_image }}:sha-${{ github.sha }}-amd64" \
273279
-t "${{ needs.detect-changes.outputs.sdk_image }}:main-amd64" \
@@ -322,6 +328,8 @@ jobs:
322328
docker buildx build \
323329
--platform linux/arm64 \
324330
--build-arg BASE_IMAGE="${{ needs.detect-changes.outputs.base_image }}:base-${{ needs.detect-changes.outputs.base_hash }}-arm64" \
331+
--cache-from type=registry,ref="${{ needs.detect-changes.outputs.sdk_image }}:buildcache-sdk-arm64" \
332+
--cache-to type=registry,ref="${{ needs.detect-changes.outputs.sdk_image }}:buildcache-sdk-arm64",mode=max \
325333
--push \
326334
-t "${{ needs.detect-changes.outputs.sdk_image }}:sha-${{ github.sha }}-arm64" \
327335
-t "${{ needs.detect-changes.outputs.sdk_image }}:main-arm64" \

docker/Dockerfile.sdk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# syntax=docker/dockerfile:1.7
2+
#
13
# Copyright 2026 LiveKit
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -45,7 +47,11 @@ RUN mkdir -p /client-sdk-cpp/client-sdk-rust/.cargo \
4547

4648
# Build and install the SDK into a fixed prefix so downstream projects can
4749
# consume the image as a prebuilt LiveKit SDK environment.
48-
RUN LLVM_VERSION="$(llvm-config --version | cut -d. -f1)" \
50+
RUN --mount=type=cache,target=/root/.cargo/registry,sharing=locked \
51+
--mount=type=cache,target=/root/.cargo/git,sharing=locked \
52+
--mount=type=cache,target=/client-sdk-cpp/client-sdk-rust/target,sharing=locked \
53+
--mount=type=cache,target=/client-sdk-cpp/build-release,sharing=locked \
54+
LLVM_VERSION="$(llvm-config --version | cut -d. -f1)" \
4955
&& export LIBCLANG_PATH="/usr/lib/llvm-${LLVM_VERSION}/lib" \
5056
&& export CXXFLAGS="-Wno-deprecated-declarations" \
5157
&& export CFLAGS="-Wno-deprecated-declarations" \

0 commit comments

Comments
 (0)