Skip to content

Commit

Permalink
Put SONiC VM image into a separate container image (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertvolkmann committed Aug 2, 2024
1 parent 6460a0d commit a9e8c77
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
10 changes: 3 additions & 7 deletions images/sonic/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
FROM debian:bookworm-slim
FROM docker.io/library/debian:bookworm-slim

ENV LIBGUESTFS_BACKEND=direct
# Check: https://sonic-build.azurewebsites.net/ui/sonic/pipelines
ARG SONIC_BASE_URL=https://sonic-build.azurewebsites.net/api/sonic/artifacts?branchName=202311&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%2Fbullseye%2Ffrr-pythontools_8.5.1-sonic-0_all.deb

RUN apt-get update && \
apt-get --no-install-recommends install --yes \
Expand All @@ -16,8 +12,8 @@ RUN apt-get update && \
qemu-system-x86 \
telnet

RUN curl --location --output - "${SONIC_IMG_URL}" | gunzip > sonic-vs.img && \
curl --location --output /frr-pythontools.deb "${FRR_RELOAD_URL}"
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

ENTRYPOINT ["/launch.py"]

Expand Down
25 changes: 25 additions & 0 deletions images/sonic/base/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=202311&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%2Fbullseye%2Ffrr-pythontools_8.5.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

0 comments on commit a9e8c77

Please sign in to comment.