Skip to content
17 changes: 9 additions & 8 deletions .github/workflows/base-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
name: build mini-lab-sonic base image
runs-on: ubuntu-latest

strategy:
matrix:
flavors:
- name: 202311
- name: 202411

steps:
- name: Log in to the container registry
uses: docker/login-action@v3
Expand All @@ -21,18 +27,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Make tag
run: |
git fetch --tags
echo "tag=$(git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push mini-lab-sonic container
- name: Build and push mini-lab-sonic-base container
uses: docker/build-push-action@v6
with:
push: true
sbom: true
file: images/sonic/base/Dockerfile
tags: ${{ env.REGISTRY }}/metal-stack/mini-lab-sonic-base:${{ env.tag }}
file: images/sonic/base-${{ matrix.flavors.name }}/Dockerfile
tags: ${{ env.REGISTRY }}/metal-stack/mini-lab-sonic-base:${{ matrix.flavors.name }}
2 changes: 2 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: ./images/machine
pull: true
push: true
sbom: true
tags: ${{ env.MINI_LAB_VM_IMAGE }}
Expand Down Expand Up @@ -76,6 +77,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: ./images/sonic
pull: true
push: true
sbom: true
tags: ${{ env.MINI_LAB_SONIC_IMAGE }}
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ test-connectivity-to-external-service-via-ipv6:
fi; \
done

.PHONY: build-sonic-base
build-sonic-base:
cd images/sonic/base-202311 && docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202311 .
cd images/sonic/base-202411 && docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202411 .

## DEV TARGETS ##

Expand Down
4 changes: 2 additions & 2 deletions images/sonic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ RUN apt-get update && \
qemu-system-x86 \
telnet

COPY --from=ghcr.io/metal-stack/mini-lab-sonic:base /sonic-vs.img /sonic-vs.img
COPY --from=ghcr.io/metal-stack/mini-lab-sonic:base /frr-pythontools.deb /frr-pythontools.deb
COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:master /sonic-vs.img /sonic-vs.img
COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:master /frr-pythontools.deb /frr-pythontools.deb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the pipeline only produce images like 202411?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I temporarily used the master tag of the image since 202311, 202411 and 202505 will be available once this PR is merged.


ENTRYPOINT ["/launch.py"]

Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions images/sonic/base-202411/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Check: https://sonic-build.azurewebsites.net/ui/sonic/pipelines
ARG SONIC_BASE_URL=https://sonic-build.azurewebsites.net/api/sonic/artifacts?branchName=202411&platform=vs
ARG SONIC_IMG_URL=${SONIC_BASE_URL}&target=target%2Fsonic-vs.img.gz
ARG FRR_RELOAD_URL=${SONIC_BASE_URL}&target=target%2Fdebs%2Fbookworm%2Ffrr-pythontools_10.0.1-sonic-0_all.deb

FROM docker.io/library/busybox:stable AS download

ARG SONIC_IMG_URL
ARG FRR_RELOAD_URL

ADD "${SONIC_IMG_URL}" /sonic-vs.img.gz
ADD "${FRR_RELOAD_URL}" /frr-pythontools.deb

RUN gunzip /sonic-vs.img.gz

FROM scratch

ARG SONIC_IMG_URL
ARG FRR_RELOAD_URL

LABEL sonic-img-url=${SONIC_IMG_URL} \
frr-reload-url=${FRR_RELOAD_URL}

COPY --from=download /frr-pythontools.deb /frr-pythontools.deb
COPY --from=download /sonic-vs.img /sonic-vs.img
Loading