Skip to content

Commit 7cf0366

Browse files
stephen-derosaalan-george-lk
authored andcommitted
docker: base and sdk images
1 parent 2692866 commit 7cf0366

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

@@ -332,6 +334,7 @@ jobs:
332334
docker-build-x64:
333335
name: Build (docker-linux-x64)
334336
runs-on: ubuntu-latest
337+
if: github.event_name == 'pull_request'
335338

336339
steps:
337340
- name: Checkout (with submodules)
@@ -351,17 +354,21 @@ jobs:
351354
docker-images: true
352355
swap-storage: true
353356

354-
- name: Set up Docker Buildx
355-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
357+
- name: Build base Docker image
358+
run: |
359+
docker build \
360+
--build-arg TARGETARCH=amd64 \
361+
-t livekit-cpp-sdk-base-x64:${{ github.sha }} \
362+
-f docker/Dockerfile.base \
363+
docker
356364
357-
- name: Build Docker image
365+
- name: Build SDK Docker image
358366
run: |
359-
docker buildx build \
360-
--platform linux/amd64 \
361-
--load \
367+
docker build \
368+
--build-arg BASE_IMAGE=livekit-cpp-sdk-base-x64:${{ github.sha }} \
362369
-t livekit-cpp-sdk-x64:${{ github.sha }} \
363370
. \
364-
-f docker/Dockerfile
371+
-f docker/Dockerfile.sdk
365372
366373
- name: Verify installed SDK inside image
367374
run: |
@@ -382,6 +389,7 @@ jobs:
382389
docker-build-linux-arm64:
383390
name: Build (docker-linux-arm64)
384391
runs-on: ubuntu-24.04-arm
392+
if: github.event_name == 'pull_request'
385393

386394
steps:
387395
- name: Checkout (with submodules)
@@ -401,17 +409,21 @@ jobs:
401409
docker-images: true
402410
swap-storage: true
403411

404-
- name: Set up Docker Buildx
405-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
412+
- name: Build base Docker image
413+
run: |
414+
docker build \
415+
--build-arg TARGETARCH=arm64 \
416+
-t livekit-cpp-sdk-base-arm64:${{ github.sha }} \
417+
-f docker/Dockerfile.base \
418+
docker
406419
407-
- name: Build Docker image
420+
- name: Build SDK Docker image
408421
run: |
409-
docker buildx build \
410-
--platform linux/arm64 \
411-
--load \
422+
docker build \
423+
--build-arg BASE_IMAGE=livekit-cpp-sdk-base-arm64:${{ github.sha }} \
412424
-t livekit-cpp-sdk:${{ github.sha }} \
413425
. \
414-
-f docker/Dockerfile
426+
-f docker/Dockerfile.sdk
415427
416428
- name: Verify installed SDK inside image
417429
run: |
@@ -433,6 +445,7 @@ jobs:
433445
name: Build (cpp-example-collection-linux-arm64)
434446
runs-on: ubuntu-24.04-arm
435447
needs: docker-build-linux-arm64
448+
if: github.event_name == 'pull_request'
436449

437450
steps:
438451
- name: Download Docker image artifact
@@ -459,6 +472,7 @@ jobs:
459472
name: Build (cpp-example-collection-x64)
460473
runs-on: ubuntu-latest
461474
needs: docker-build-x64
475+
if: github.event_name == 'pull_request'
462476

463477
steps:
464478
- name: Download Docker image artifact

0 commit comments

Comments
 (0)