switch to multi-stage build, prepare multi-arch build

This commit is contained in:
John
2021-01-17 14:02:07 +01:00
parent 9ab7739704
commit d186bc64ff
11 changed files with 248 additions and 76 deletions
+27 -17
View File
@@ -1,13 +1,29 @@
FROM debian:stretch
FROM debian:stretch as build
RUN apt-get update && apt-get install -y \
libmosquitto-dev libstdc++6 libc6 libgcc1 \
curl \
autoconf automake g++ make git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
ENV EBUSD_VERSION 21.1
ENV EBUSD_ARCH amd64
RUN git clone https://github.com/john30/ebusd.git /build \
&& ./make_debian.sh
ARG UPLOAD_URL
ARG UPLOAD_CREDENTIALS
FROM debian:stretch-slim
RUN apt-get update && apt-get install -y \
logrotate libmosquitto1 libstdc++6 libc6 libgcc1 \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
autoconf automake g++ make git \
libmosquitto-dev \
&& rm -rf /var/lib/apt/lists/*
LABEL maintainer "ebusd@ebusd.eu"
@@ -17,19 +33,13 @@ ENV EBUSD_ARCH amd64
LABEL version "${EBUSD_VERSION}-${EBUSD_ARCH}-devel"
WORKDIR /build
COPY --from=build /build/ebusd-*_mqtt1.deb ebusd.deb
RUN (curl -SL https://github.com/john30/ebusd/archive/master.tar.gz \
| tar xz --strip-components=1) \
&& ./autogen.sh \
&& make install-strip
WORKDIR /
RUN rm -rf /build
RUN dpkg -i ebusd.deb \
&& rm -f ebusd.deb
EXPOSE 8888
COPY release/docker-entrypoint.sh /
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["-f", "--scanconfig"]