forked from home-assistant/builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (41 loc) · 1.37 KB
/
Dockerfile
File metadata and controls
45 lines (41 loc) · 1.37 KB
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
40
41
42
43
44
45
ARG BUILD_FROM
FROM $BUILD_FROM
ARG \
BUILD_ARCH \
CAS_VERSION \
YQ_VERSION
RUN \
set -x \
&& apk add --no-cache \
git \
docker \
docker-cli-buildx \
coreutils \
&& apk add --no-cache --virtual .build-dependencies \
build-base \
go \
\
&& git clone -b v${CAS_VERSION} --depth 1 \
https://github.com/codenotary/cas \
&& cd cas \
&& make cas \
&& mv cas /usr/bin/cas \
&& 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"; \
elif [ "${BUILD_ARCH}" = "aarch64" ]; then \
wget -q -O /usr/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_arm64"; \
elif [ "${BUILD_ARCH}" = "i386" ]; then \
wget -q -O /usr/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_386"; \
elif [ "${BUILD_ARCH}" = "amd64" ]; then \
wget -q -O /usr/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64"; \
else \
exit 1; \
fi \
&& chmod +x /usr/bin/yq \
\
&& apk del .build-dependencies \
&& rm -rf /root/go /root/.cache \
&& rm -rf /usr/src/cas
COPY builder.sh /usr/bin/
WORKDIR /data
ENTRYPOINT ["/usr/bin/builder.sh"]