diff --git a/Dockerfile b/Dockerfile index fd5c2b1..13f624b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM debian:bullseye-slim as builder-stage +ARG baseimage=debian:bullseye-slim +FROM ${baseimage} as builder-stage +ARG buildoptions # workaround for memory bug https://github.com/rust-lang/cargo/issues/10583 ENV CARGO_NET_GIT_FETCH_WITH_CLI=true ENV DEBIAN_FRONTEND=noninteractive @@ -14,7 +16,7 @@ COPY . /build/ WORKDIR /build SHELL ["/bin/bash", "-c"] -RUN source ~/.cargo/env && ./build.sh +RUN source ~/.cargo/env && ./build.sh ${buildoptions} FROM scratch -COPY --from=builder-stage /build/packages/* / +COPY --from=builder-stage /build/*.log /build/packages/* / diff --git a/README.md b/README.md index 99b3080..11bd2d2 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,12 @@ You can build arm64 .deb packages using the provided Dockerfile and docker build docker buildx build -o packages --platform linux/arm64 . ``` +You can also set build arguments for base image and build.sh options: + +``` +docker buildx build -o packages --build-arg buildoptions="client debug" --build-arg baseimage=ubuntu:jammy --platform linux/arm64 . +``` + Once the docker build is completed, packages will be copied from the docker build image to a folder named `packages` in the root folder. ## Install all needed packages