Fuegovic commited on
Commit
16f0bfc
1 Parent(s): bbb15e3

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -0
Dockerfile ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine:3.16.6 as builder
2
+
3
+ ARG VERSION
4
+ ARG TARGETPLATFORM
5
+
6
+ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
7
+ echo "aarch64" > arch; \
8
+ echo "musl" > env; \
9
+ elif [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
10
+ echo "x86_64" > arch; \
11
+ echo "musl" > env; \
12
+ elif [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
13
+ echo "armv7" > arch; \
14
+ echo "musleabi" > env; \
15
+ elif [ "${TARGETPLATFORM}" = "linux/arm/v6" ]; then \
16
+ echo "arm" > arch; \
17
+ echo "musleabi" > env; \
18
+ fi
19
+ RUN apk update && apk add wget
20
+ RUN wget https://github.com/gngpp/ninja/releases/download/v${VERSION}/ninja-${VERSION}-$(cat arch)-unknown-linux-$(cat env).tar.gz
21
+ RUN tar -xvf ninja-${VERSION}-$(cat arch)-unknown-linux-$(cat env).tar.gz
22
+
23
+ FROM alpine:3.16.6
24
+
25
+ LABEL org.opencontainers.image.authors "gngpp <[email protected]>"
26
+ LABEL org.opencontainers.image.source https://github.com/gngpp/ninja
27
+ LABEL name ninja
28
+ LABEL url https://github.com/gngpp/ninja
29
+
30
+ ENV LANG=C.UTF-8 DEBIAN_FRONTEND=noninteractive LANG=zh_CN.UTF-8 LANGUAGE=zh_CN.UTF-8 LC_ALL=C
31
+
32
+ COPY --from=builder /ninja /bin/ninja
33
+
34
+ ENTRYPOINT ["/bin/ninja"]