Merge pull request #32 from antoniofagardo/add-arm-dockerfile
Add dockerfile for linux arm5, 6, 7 and arm64
This commit is contained in:
commit
fac177c096
4 changed files with 72 additions and 0 deletions
18
Dockerfile.arm5
Normal file
18
Dockerfile.arm5
Normal 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
18
Dockerfile.arm6
Normal 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
18
Dockerfile.arm64
Normal 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
18
Dockerfile.arm7
Normal 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"]
|
Loading…
Reference in a new issue