Add dockerfile for arm5, 6, 7 and arm64

This commit is contained in:
Antoine Gosset 2020-07-22 12:28:04 -07:00
parent 14c6071be2
commit 86bf29072e
4 changed files with 72 additions and 0 deletions

18
Dockerfile.arm5 Normal file
View file

@ -0,0 +1,18 @@
# stage 0
FROM golang:latest as builder
WORKDIR /go/src/github.com/PierreZ/goStatic
COPY . .
RUN mkdir ./bin && \
CGO_ENABLED=0 GOARCH=arm GOARM=5 GOOS=linux go build -tags netgo -installsuffix netgo -o ./bin/goStatic && \
mkdir ./bin/etc && \
ID=$(shuf -i 100-9999 -n 1) && \
echo $ID && \
echo "appuser:x:$ID:$ID::/sbin/nologin:/bin/false" > ./bin/etc/passwd && \
echo "appgroup:x:$ID:appuser" > ./bin/etc/group
# stage 1
FROM scratch
WORKDIR /
COPY --from=builder /go/src/github.com/PierreZ/goStatic/bin/ .
USER appuser
ENTRYPOINT ["/goStatic"]

18
Dockerfile.arm6 Normal file
View file

@ -0,0 +1,18 @@
# stage 0
FROM golang:latest as builder
WORKDIR /go/src/github.com/PierreZ/goStatic
COPY . .
RUN mkdir ./bin && \
CGO_ENABLED=0 GOARCH=arm GOARM=6 GOOS=linux go build -tags netgo -installsuffix netgo -o ./bin/goStatic && \
mkdir ./bin/etc && \
ID=$(shuf -i 100-9999 -n 1) && \
echo $ID && \
echo "appuser:x:$ID:$ID::/sbin/nologin:/bin/false" > ./bin/etc/passwd && \
echo "appgroup:x:$ID:appuser" > ./bin/etc/group
# stage 1
FROM scratch
WORKDIR /
COPY --from=builder /go/src/github.com/PierreZ/goStatic/bin/ .
USER appuser
ENTRYPOINT ["/goStatic"]

18
Dockerfile.arm64 Normal file
View file

@ -0,0 +1,18 @@
# stage 0
FROM golang:latest as builder
WORKDIR /go/src/github.com/PierreZ/goStatic
COPY . .
RUN mkdir ./bin && \
CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -tags netgo -installsuffix netgo -o ./bin/goStatic && \
mkdir ./bin/etc && \
ID=$(shuf -i 100-9999 -n 1) && \
echo $ID && \
echo "appuser:x:$ID:$ID::/sbin/nologin:/bin/false" > ./bin/etc/passwd && \
echo "appgroup:x:$ID:appuser" > ./bin/etc/group
# stage 1
FROM scratch
WORKDIR /
COPY --from=builder /go/src/github.com/PierreZ/goStatic/bin/ .
USER appuser
ENTRYPOINT ["/goStatic"]

18
Dockerfile.arm7 Normal file
View file

@ -0,0 +1,18 @@
# stage 0
FROM golang:latest as builder
WORKDIR /go/src/github.com/PierreZ/goStatic
COPY . .
RUN mkdir ./bin && \
CGO_ENABLED=0 GOARCH=arm GOARM=7 GOOS=linux go build -tags netgo -installsuffix netgo -o ./bin/goStatic && \
mkdir ./bin/etc && \
ID=$(shuf -i 100-9999 -n 1) && \
echo $ID && \
echo "appuser:x:$ID:$ID::/sbin/nologin:/bin/false" > ./bin/etc/passwd && \
echo "appgroup:x:$ID:appuser" > ./bin/etc/group
# stage 1
FROM scratch
WORKDIR /
COPY --from=builder /go/src/github.com/PierreZ/goStatic/bin/ .
USER appuser
ENTRYPOINT ["/goStatic"]