Skip to content

Commit

Permalink
Use stages during docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
jlatusek committed Apr 8, 2024
1 parent 3a11499 commit 8c8b4a2
Showing 1 changed file with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
ARG VERSION=latest
FROM ghcr.io/project-chip/chip-build:${VERSION}
ARG UBUNTU_QEMU_DIR_DEFAULT="/opt/ubuntu-qemu"
ARG UBUNTU_QEMU_IMG_DEFAULT="${UBUNTU_QEMU_DIR_DEFAULT}/ubuntu-20.04.img"

FROM ghcr.io/project-chip/chip-build:${VERSION} as build-env
LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip

ARG KERNEL_VERSION=6.7.3
ARG BLUEZ_VERSION=5.72
ARG ELL_VERSION=0.62
ARG KERNEL_VERSION=6.7.3
ARG UBUNTU_QEMU_DIR_DEFAULT
ARG UBUNTU_QEMU_IMG_DEFAULT

ENV UBUNTU_QEMU_DIR=${UBUNTU_QEMU_DIR_DEFAULT}
ENV UBUNTU_QEMU_IMG=${UBUNTU_QEMU_IMG_DEFAULT}

ENV UBUNTU_QEMU_IMG="/opt/ubuntu-qemu/ubuntu-20.04.img"
ENV PW_ENVIRONMENT_ROOT="/root/pw_root"

RUN mkdir -p /tmp/workdir/linux
COPY files/linux/0001-Bluetooth-MGMT-Synchronize-scan-start-and-LE-Meta-ev.patch /tmp/workdir/linux/0001-Bluetooth-MGMT-Synchronize-scan-start-and-LE-Meta-ev.patch
Expand Down Expand Up @@ -189,4 +195,23 @@ RUN mkdir -p /tmp/workdir/linux \
&& rm -rf /tmp/* \
&& : # last line

FROM ghcr.io/project-chip/chip-build:${VERSION}

ARG UBUNTU_QEMU_DIR_DEFAULT
ARG UBUNTU_QEMU_IMG_DEFAULT

ENV UBUNTU_QEMU_DIR=${UBUNTU_QEMU_DIR_DEFAULT}
ENV UBUNTU_QEMU_IMG=${UBUNTU_QEMU_IMG_DEFAULT}
ENV PW_ENVIRONMENT_ROOT="/root/pw_root"

RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy \
qemu \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/* \
&& : # last line
COPY --from=build-env ${UBUNTU_QEMU_DIR} ${UBUNTU_QEMU_DIR}

WORKDIR /chip

0 comments on commit 8c8b4a2

Please sign in to comment.