remove unnecessary parts, add arm32v5, allow using different dir+image
This commit is contained in:
@@ -9,15 +9,12 @@ RUN apt-get update && apt-get install -y \
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ENV EBUSD_VERSION 21.1
|
|
||||||
ENV EBUSD_ARCH amd64
|
ENV EBUSD_ARCH amd64
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
|
||||||
RUN git clone https://github.com/john30/ebusd.git /build \
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
&& ./make_debian.sh
|
&& ./make_debian.sh
|
||||||
|
|
||||||
ARG UPLOAD_URL
|
|
||||||
ARG UPLOAD_CREDENTIALS
|
|
||||||
ARG UPLOAD_ONLY
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
FROM multiarch/qemu-user-static as qemu
|
||||||
|
FROM arm32v5/debian:stretch as build
|
||||||
|
COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin/
|
||||||
|
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_ARCH arm32v5
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
|
||||||
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
|
&& ./make_debian.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FROM arm32v5/debian:stretch-slim
|
||||||
|
COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin/
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
logrotate libmosquitto1 libstdc++6 libc6 libgcc1 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
LABEL maintainer "ebusd@ebusd.eu"
|
||||||
|
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
ENV EBUSD_ARCH arm32v5
|
||||||
|
|
||||||
|
LABEL version "${EBUSD_VERSION}-${EBUSD_ARCH}-devel"
|
||||||
|
|
||||||
|
COPY --from=build /build/ebusd-*_mqtt1.deb ebusd.deb
|
||||||
|
|
||||||
|
RUN dpkg -i ebusd.deb \
|
||||||
|
&& rm -f ebusd.deb /usr/bin/qemu-arm-static
|
||||||
|
|
||||||
|
EXPOSE 8888
|
||||||
|
|
||||||
|
COPY docker-entrypoint.sh /
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
|
CMD ["-f", "--scanconfig"]
|
||||||
@@ -9,15 +9,12 @@ RUN apt-get update && apt-get install -y \
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ENV EBUSD_VERSION 21.1
|
|
||||||
ENV EBUSD_ARCH arm32v7
|
ENV EBUSD_ARCH arm32v7
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
|
||||||
RUN git clone https://github.com/john30/ebusd.git /build \
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
&& ./make_debian.sh
|
&& ./make_debian.sh
|
||||||
|
|
||||||
ARG UPLOAD_URL
|
|
||||||
ARG UPLOAD_CREDENTIALS
|
|
||||||
ARG UPLOAD_ONLY
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,15 +9,12 @@ RUN apt-get update && apt-get install -y \
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ENV EBUSD_VERSION 21.1
|
|
||||||
ENV EBUSD_ARCH arm64v8
|
ENV EBUSD_ARCH arm64v8
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
|
||||||
RUN git clone https://github.com/john30/ebusd.git /build \
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
&& ./make_debian.sh
|
&& ./make_debian.sh
|
||||||
|
|
||||||
ARG UPLOAD_URL
|
|
||||||
ARG UPLOAD_CREDENTIALS
|
|
||||||
ARG UPLOAD_ONLY
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,15 +9,12 @@ RUN apt-get update && apt-get install -y \
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ENV EBUSD_VERSION 21.1
|
|
||||||
ENV EBUSD_ARCH i386
|
ENV EBUSD_ARCH i386
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
|
||||||
RUN git clone https://github.com/john30/ebusd.git /build \
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
&& ./make_debian.sh
|
&& ./make_debian.sh
|
||||||
|
|
||||||
ARG UPLOAD_URL
|
|
||||||
ARG UPLOAD_CREDENTIALS
|
|
||||||
ARG UPLOAD_ONLY
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,16 +9,13 @@ RUN apt-get update && apt-get install -y \
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ENV EBUSD_VERSION %EBUSD_VERSION%
|
|
||||||
ENV EBUSD_ARCH %EBUSD_ARCH%
|
ENV EBUSD_ARCH %EBUSD_ARCH%
|
||||||
|
ENV EBUSD_VERSION %EBUSD_VERSION%
|
||||||
|
|
||||||
RUN git clone https://github.com/john30/ebusd.git /build \
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
&& %EBUSD_MAKE%
|
&& %EBUSD_MAKE%
|
||||||
|
|
||||||
ARG UPLOAD_URL
|
%EBUSD_UPLOAD_LINES%
|
||||||
ARG UPLOAD_CREDENTIALS
|
|
||||||
ARG UPLOAD_ONLY
|
|
||||||
%EBUSD_UPLOAD_LINE%
|
|
||||||
|
|
||||||
|
|
||||||
FROM %BASE_IMAGE%-slim
|
FROM %BASE_IMAGE%-slim
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ To download the latest release image from the hub, use the following command:
|
|||||||
The image is able to run on any of the following architectures and the right image will be picked automatically:
|
The image is able to run on any of the following architectures and the right image will be picked automatically:
|
||||||
* amd64
|
* amd64
|
||||||
* i386
|
* i386
|
||||||
|
* arm32v5
|
||||||
* arm32v7
|
* arm32v7
|
||||||
* arm64v8
|
* arm64v8
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ manifests:
|
|||||||
platform:
|
platform:
|
||||||
architecture: 386
|
architecture: 386
|
||||||
os: linux
|
os: linux
|
||||||
|
- image: %image_name%-arm32v5
|
||||||
|
platform:
|
||||||
|
architecture: arm
|
||||||
|
os: linux
|
||||||
|
variant: v5
|
||||||
- image: %image_name%-arm32v7
|
- image: %image_name%-arm32v7
|
||||||
platform:
|
platform:
|
||||||
architecture: arm
|
architecture: arm
|
||||||
|
|||||||
@@ -9,16 +9,13 @@ RUN apt-get update && apt-get install -y \
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ENV EBUSD_VERSION 21.1
|
|
||||||
ENV EBUSD_ARCH amd64
|
ENV EBUSD_ARCH amd64
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
|
||||||
RUN git clone https://github.com/john30/ebusd.git /build \
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
&& ./make_all.sh
|
&& ./make_all.sh
|
||||||
|
|
||||||
ARG UPLOAD_URL
|
|
||||||
ARG UPLOAD_CREDENTIALS
|
|
||||||
ARG UPLOAD_ONLY
|
|
||||||
RUN if [ -n "$UPLOAD_URL" ] && [ -n "$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo "upload $img"; curl -u "$UPLOAD_CREDENTIALS" -s -X POST --data-binary "@$img" -H "Content-Type: application/octet-stream" "$UPLOAD_URL/$img?a=$EBUSD_ARCH&v=$EBUSD_VERSION"; done; if [ -n "$UPLOAD_ONLY" ]; then echo "stopping for upload only"; exit 139; fi fi
|
|
||||||
|
|
||||||
|
|
||||||
FROM debian:stretch-slim
|
FROM debian:stretch-slim
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
FROM multiarch/qemu-user-static as qemu
|
||||||
|
FROM arm32v5/debian:stretch as build
|
||||||
|
COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin/
|
||||||
|
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_ARCH arm32v5
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
|
||||||
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
|
&& ./make_all.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FROM arm32v5/debian:stretch-slim
|
||||||
|
COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin/
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
logrotate libmosquitto1 libstdc++6 libc6 libgcc1 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
LABEL maintainer "ebusd@ebusd.eu"
|
||||||
|
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
ENV EBUSD_ARCH arm32v5
|
||||||
|
|
||||||
|
LABEL version "${EBUSD_VERSION}-${EBUSD_ARCH}"
|
||||||
|
|
||||||
|
COPY --from=build /build/ebusd-*_mqtt1.deb ebusd.deb
|
||||||
|
|
||||||
|
RUN dpkg -i ebusd.deb \
|
||||||
|
&& rm -f ebusd.deb /usr/bin/qemu-arm-static
|
||||||
|
|
||||||
|
EXPOSE 8888
|
||||||
|
|
||||||
|
COPY docker-entrypoint.sh /
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
|
CMD ["-f", "--scanconfig"]
|
||||||
@@ -9,16 +9,13 @@ RUN apt-get update && apt-get install -y \
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ENV EBUSD_VERSION 21.1
|
|
||||||
ENV EBUSD_ARCH arm32v7
|
ENV EBUSD_ARCH arm32v7
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
|
||||||
RUN git clone https://github.com/john30/ebusd.git /build \
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
&& ./make_all.sh
|
&& ./make_all.sh
|
||||||
|
|
||||||
ARG UPLOAD_URL
|
|
||||||
ARG UPLOAD_CREDENTIALS
|
|
||||||
ARG UPLOAD_ONLY
|
|
||||||
RUN if [ -n "$UPLOAD_URL" ] && [ -n "$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo "upload $img"; curl -u "$UPLOAD_CREDENTIALS" -s -X POST --data-binary "@$img" -H "Content-Type: application/octet-stream" "$UPLOAD_URL/$img?a=$EBUSD_ARCH&v=$EBUSD_VERSION"; done; if [ -n "$UPLOAD_ONLY" ]; then echo "stopping for upload only"; exit 139; fi fi
|
|
||||||
|
|
||||||
|
|
||||||
FROM arm32v7/debian:stretch-slim
|
FROM arm32v7/debian:stretch-slim
|
||||||
|
|||||||
@@ -9,16 +9,13 @@ RUN apt-get update && apt-get install -y \
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ENV EBUSD_VERSION 21.1
|
|
||||||
ENV EBUSD_ARCH arm64v8
|
ENV EBUSD_ARCH arm64v8
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
|
||||||
RUN git clone https://github.com/john30/ebusd.git /build \
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
&& ./make_all.sh
|
&& ./make_all.sh
|
||||||
|
|
||||||
ARG UPLOAD_URL
|
|
||||||
ARG UPLOAD_CREDENTIALS
|
|
||||||
ARG UPLOAD_ONLY
|
|
||||||
RUN if [ -n "$UPLOAD_URL" ] && [ -n "$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo "upload $img"; curl -u "$UPLOAD_CREDENTIALS" -s -X POST --data-binary "@$img" -H "Content-Type: application/octet-stream" "$UPLOAD_URL/$img?a=$EBUSD_ARCH&v=$EBUSD_VERSION"; done; if [ -n "$UPLOAD_ONLY" ]; then echo "stopping for upload only"; exit 139; fi fi
|
|
||||||
|
|
||||||
|
|
||||||
FROM arm64v8/debian:stretch-slim
|
FROM arm64v8/debian:stretch-slim
|
||||||
|
|||||||
@@ -9,16 +9,13 @@ RUN apt-get update && apt-get install -y \
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ENV EBUSD_VERSION 21.1
|
|
||||||
ENV EBUSD_ARCH i386
|
ENV EBUSD_ARCH i386
|
||||||
|
ENV EBUSD_VERSION 21.1
|
||||||
|
|
||||||
RUN git clone https://github.com/john30/ebusd.git /build \
|
RUN git clone https://github.com/john30/ebusd.git /build \
|
||||||
&& ./make_all.sh
|
&& ./make_all.sh
|
||||||
|
|
||||||
ARG UPLOAD_URL
|
|
||||||
ARG UPLOAD_CREDENTIALS
|
|
||||||
ARG UPLOAD_ONLY
|
|
||||||
RUN if [ -n "$UPLOAD_URL" ] && [ -n "$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo "upload $img"; curl -u "$UPLOAD_CREDENTIALS" -s -X POST --data-binary "@$img" -H "Content-Type: application/octet-stream" "$UPLOAD_URL/$img?a=$EBUSD_ARCH&v=$EBUSD_VERSION"; done; if [ -n "$UPLOAD_ONLY" ]; then echo "stopping for upload only"; exit 139; fi fi
|
|
||||||
|
|
||||||
|
|
||||||
FROM i386/debian:stretch-slim
|
FROM i386/debian:stretch-slim
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
BASE_IMAGE=debian:stretch
|
DEFAULT_IMAGE=debian:stretch
|
||||||
EBUSD_VERSION=`cat ../../VERSION`
|
EBUSD_VERSION=`cat ../../VERSION`
|
||||||
|
|
||||||
archs='amd64 i386 arm32v7:arm arm64v8:aarch64'
|
archs='amd64 i386 arm32v5:arm arm32v7:arm arm64v8:aarch64'
|
||||||
|
|
||||||
function replaceTemplate () {
|
function replaceTemplate () {
|
||||||
prefix=
|
prefix=
|
||||||
@@ -21,18 +21,19 @@ function replaceTemplate () {
|
|||||||
fi
|
fi
|
||||||
sed \
|
sed \
|
||||||
-e "s#%QEMU_FROM_LINE%#${qemu_from_line}#g" \
|
-e "s#%QEMU_FROM_LINE%#${qemu_from_line}#g" \
|
||||||
-e "s#%BASE_IMAGE%#${prefix}${BASE_IMAGE}#g" \
|
-e "s#%BASE_IMAGE%#${prefix}${BASE_IMAGE:-$DEFAULT_IMAGE}#g" \
|
||||||
-e "s#%QEMU_FROM_COPY%#${qemu_from_copy}#g" \
|
-e "s#%QEMU_FROM_COPY%#${qemu_from_copy}#g" \
|
||||||
-e "s#%EBUSD_MAKE%#${make}#g" \
|
-e "s#%EBUSD_MAKE%#${make}#g" \
|
||||||
-e "s#%EBUSD_VERSION%#${EBUSD_VERSION}#g" \
|
-e "s#%EBUSD_VERSION%#${EBUSD_VERSION}#g" \
|
||||||
-e "s#%EBUSD_VERSION_VARIANT%#${version_variant}#g" \
|
-e "s#%EBUSD_VERSION_VARIANT%#${version_variant}#g" \
|
||||||
-e "s#%EBUSD_ARCH%#${arch}#g" \
|
-e "s#%EBUSD_ARCH%#${arch}#g" \
|
||||||
-e "s#%EXTRA_RM%#${extra_rm}#g" \
|
-e "s#%EXTRA_RM%#${extra_rm}#g" \
|
||||||
-e "s#%EBUSD_UPLOAD_LINE%#${upload_line}#g" \
|
-e "s#%EBUSD_UPLOAD_LINES%#${upload_lines}#g" \
|
||||||
Dockerfile.template > "${dir}Dockerfile${suffix}"
|
Dockerfile.template > "${dir}Dockerfile${suffix}"
|
||||||
echo "updated ${dir}Dockerfile${suffix}"
|
echo "updated ${dir}Dockerfile${suffix}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
# devel updates
|
# devel updates
|
||||||
version_variant='-devel'
|
version_variant='-devel'
|
||||||
make='./make_debian.sh'
|
make='./make_debian.sh'
|
||||||
@@ -41,12 +42,15 @@ upload_line=''
|
|||||||
for arch in $archs; do
|
for arch in $archs; do
|
||||||
replaceTemplate
|
replaceTemplate
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# release updates
|
# release updates
|
||||||
version_variant=''
|
version_variant=''
|
||||||
make='./make_all.sh'
|
make='./make_all.sh'
|
||||||
dir='release/'
|
dir=${1:-release/}
|
||||||
upload_line='RUN if [ -n "\$UPLOAD_URL" ] \&\& [ -n "\$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo "upload \$img"; curl -u "\$UPLOAD_CREDENTIALS" -s -X POST --data-binary "@\$img" -H "Content-Type: application/octet-stream" "\$UPLOAD_URL/\$img?a=\$EBUSD_ARCH\&v=\$EBUSD_VERSION"; done; if [ -n "\$UPLOAD_ONLY" ]; then echo "stopping for upload only"; exit 139; fi fi'
|
if [[ -n "$1" ]]; then
|
||||||
|
upload_lines='ARG UPLOAD_URL\nARG UPLOAD_CREDENTIALS\nARG UPLOAD_OS\nARG UPLOAD_ONLY\nRUN if [ -n "\$UPLOAD_URL" ] \&\& [ -n "\$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo -n "upload \$img: "; curl -fs -u "\$UPLOAD_CREDENTIALS" -X POST --data-binary "@\$img" -H "Content-Type: application/octet-stream" "\$UPLOAD_URL/\$img?a=\$EBUSD_ARCH\&o=\$UPLOAD_OS\&v=\$EBUSD_VERSION" || echo "failed"; done; if [ -n "\$UPLOAD_ONLY" ]; then echo "stopping for upload only"; exit 139; fi fi'
|
||||||
|
fi
|
||||||
for arch in $archs; do
|
for arch in $archs; do
|
||||||
replaceTemplate
|
replaceTemplate
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user