switch to using docker buildx with multi-arch

This commit is contained in:
John
2021-11-10 20:16:26 +01:00
parent c09ba1e686
commit 6faa52bdd4
14 changed files with 139 additions and 453 deletions
+20 -10
View File
@@ -1,5 +1,6 @@
ARG BASE_IMAGE
FROM debian:bullseye as build
FROM $BASE_IMAGE as build
RUN apt-get update && apt-get install -y \
libmosquitto-dev libstdc++6 libc6 libgcc1 \
@@ -9,16 +10,20 @@ RUN apt-get update && apt-get install -y \
WORKDIR /build
ENV EBUSD_ARCH amd64
ENV EBUSD_VERSION 21.3
ARG TARGETARCH
ARG TARGETVARIANT
ARG EBUSD_VERSION
RUN git clone https://github.com/john30/ebusd.git /build \
&& ./make_debian.sh
ENV EBUSD_ARCH $TARGETARCH$TARGETVARIANT
ENV EBUSD_VERSION $EBUSD_VERSION
ADD . /build
RUN ./make_debian.sh
FROM debian:bullseye-slim
FROM $BASE_IMAGE-slim as image
RUN apt-get update && apt-get install -y \
libmosquitto1 libstdc++6 libc6 libgcc1 \
@@ -26,12 +31,17 @@ RUN apt-get update && apt-get install -y \
LABEL maintainer "ebusd@ebusd.eu"
ENV EBUSD_VERSION 21.3
ENV EBUSD_ARCH amd64
ARG TARGETARCH
ARG TARGETVARIANT
ARG EBUSD_VERSION
ARG EBUSD_IMAGE
ENV EBUSD_ARCH $TARGETARCH$TARGETVARIANT
ENV EBUSD_VERSION $EBUSD_VERSION
LABEL version "${EBUSD_VERSION}-${EBUSD_ARCH}"
COPY --from=build /build/ebusd-*_mqtt1.deb ebusd.deb
ADD https://github.com/john30/ebusd/releases/download/v${EBUSD_VERSION}/ebusd-${EBUSD_VERSION}_${TARGETARCH}${TARGETVARIANT}-${EBUSD_IMAGE}_mqtt1.deb ebusd.deb
RUN dpkg -i ebusd.deb \
&& ebusd -V \
@@ -39,6 +49,6 @@ RUN dpkg -i ebusd.deb \
EXPOSE 8888
COPY docker-entrypoint.sh /
COPY contrib/docker/docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["-f", "--scanconfig"]