-
-
Notifications
You must be signed in to change notification settings - Fork 64
/
Dockerfile
39 lines (35 loc) · 1.62 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
ARG BUILD_FROM
FROM $BUILD_FROM
ARG \
BUILD_ARCH \
YQ_VERSION \
COSIGN_VERSION
RUN \
set -x \
&& apk add --no-cache \
git \
docker \
docker-cli-buildx \
coreutils \
\
&& if [ "${BUILD_ARCH}" = "armhf" ] || [ "${BUILD_ARCH}" = "armv7" ]; then \
wget -q -O /usr/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_arm"; \
wget -q -O /usr/bin/cosign "https://github.com/home-assistant/cosign/releases/download/${COSIGN_VERSION}/cosign_armhf"; \
elif [ "${BUILD_ARCH}" = "aarch64" ]; then \
wget -q -O /usr/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_arm64"; \
wget -q -O /usr/bin/cosign "https://github.com/home-assistant/cosign/releases/download/${COSIGN_VERSION}/cosign_aarch64"; \
elif [ "${BUILD_ARCH}" = "i386" ]; then \
wget -q -O /usr/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_386"; \
wget -q -O /usr/bin/cosign "https://github.com/home-assistant/cosign/releases/download/${COSIGN_VERSION}/cosign_i386"; \
elif [ "${BUILD_ARCH}" = "amd64" ]; then \
wget -q -O /usr/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64"; \
wget -q -O /usr/bin/cosign "https://github.com/home-assistant/cosign/releases/download/${COSIGN_VERSION}/cosign_amd64"; \
else \
exit 1; \
fi \
&& git config --global --add safe.directory "*" \
&& chmod +x /usr/bin/yq \
&& chmod +x /usr/bin/cosign
COPY builder.sh /usr/bin/
WORKDIR /data
ENTRYPOINT ["/usr/bin/builder.sh"]