Skip to content

Commit 838962c

Browse files
docker: base and sdk images
1 parent 5555e0b commit 838962c

5 files changed

Lines changed: 561 additions & 52 deletions

File tree

.github/workflows/builds.yml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ on:
1414
- build.cmd
1515
- vcpkg.json
1616
- CMakePresets.json
17-
- docker/Dockerfile
17+
- docker/Dockerfile.base
18+
- docker/Dockerfile.sdk
1819
- .github/workflows/**
1920
pull_request:
2021
branches: ["main"]
@@ -29,7 +30,8 @@ on:
2930
- build.cmd
3031
- vcpkg.json
3132
- CMakePresets.json
32-
- docker/Dockerfile
33+
- docker/Dockerfile.base
34+
- docker/Dockerfile.sdk
3335
- .github/workflows/**
3436
workflow_dispatch:
3537

@@ -306,6 +308,7 @@ jobs:
306308
docker-build-x64:
307309
name: Build (docker-linux-x64)
308310
runs-on: ubuntu-latest
311+
if: github.event_name == 'pull_request'
309312

310313
steps:
311314
- name: Checkout (with submodules)
@@ -325,17 +328,21 @@ jobs:
325328
docker-images: true
326329
swap-storage: true
327330

328-
- name: Set up Docker Buildx
329-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
331+
- name: Build base Docker image
332+
run: |
333+
docker build \
334+
--build-arg TARGETARCH=amd64 \
335+
-t livekit-cpp-sdk-base-x64:${{ github.sha }} \
336+
-f docker/Dockerfile.base \
337+
docker
330338
331-
- name: Build Docker image
339+
- name: Build SDK Docker image
332340
run: |
333-
docker buildx build \
334-
--platform linux/amd64 \
335-
--load \
341+
docker build \
342+
--build-arg BASE_IMAGE=livekit-cpp-sdk-base-x64:${{ github.sha }} \
336343
-t livekit-cpp-sdk-x64:${{ github.sha }} \
337344
. \
338-
-f docker/Dockerfile
345+
-f docker/Dockerfile.sdk
339346
340347
- name: Verify installed SDK inside image
341348
run: |
@@ -356,6 +363,7 @@ jobs:
356363
docker-build-linux-arm64:
357364
name: Build (docker-linux-arm64)
358365
runs-on: ubuntu-24.04-arm
366+
if: github.event_name == 'pull_request'
359367

360368
steps:
361369
- name: Checkout (with submodules)
@@ -375,17 +383,21 @@ jobs:
375383
docker-images: true
376384
swap-storage: true
377385

378-
- name: Set up Docker Buildx
379-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
386+
- name: Build base Docker image
387+
run: |
388+
docker build \
389+
--build-arg TARGETARCH=arm64 \
390+
-t livekit-cpp-sdk-base-arm64:${{ github.sha }} \
391+
-f docker/Dockerfile.base \
392+
docker
380393
381-
- name: Build Docker image
394+
- name: Build SDK Docker image
382395
run: |
383-
docker buildx build \
384-
--platform linux/arm64 \
385-
--load \
396+
docker build \
397+
--build-arg BASE_IMAGE=livekit-cpp-sdk-base-arm64:${{ github.sha }} \
386398
-t livekit-cpp-sdk:${{ github.sha }} \
387399
. \
388-
-f docker/Dockerfile
400+
-f docker/Dockerfile.sdk
389401
390402
- name: Verify installed SDK inside image
391403
run: |
@@ -407,6 +419,7 @@ jobs:
407419
name: Build (cpp-example-collection-linux-arm64)
408420
runs-on: ubuntu-24.04-arm
409421
needs: docker-build-linux-arm64
422+
if: github.event_name == 'pull_request'
410423

411424
steps:
412425
- name: Download Docker image artifact
@@ -433,6 +446,7 @@ jobs:
433446
name: Build (cpp-example-collection-x64)
434447
runs-on: ubuntu-latest
435448
needs: docker-build-x64
449+
if: github.event_name == 'pull_request'
436450

437451
steps:
438452
- name: Download Docker image artifact

0 commit comments

Comments
 (0)