2020-10-17 19:57:26 +00:00
|
|
|
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.14-alpine as builder
|
|
|
|
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG BUILDPLATFORM
|
|
|
|
ARG TARGETOS
|
|
|
|
ARG TARGETARCH
|
|
|
|
|
|
|
|
WORKDIR /app/
|
2020-10-17 21:12:32 +00:00
|
|
|
RUN apk update && apk add --no-cache --update gcc musl-dev git && adduser -D -g '' gopher && apk add -U --no-cache ca-certificates
|
2020-10-18 10:01:47 +00:00
|
|
|
RUN go get github.com/mattn/go-sqlite3
|
2020-10-17 19:57:26 +00:00
|
|
|
ADD go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
ADD . .
|
2020-10-17 21:12:32 +00:00
|
|
|
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o gopherss .
|
2020-10-17 19:57:26 +00:00
|
|
|
|
2020-10-18 10:01:47 +00:00
|
|
|
COPY ./views /app/
|
|
|
|
|
2020-10-17 19:57:26 +00:00
|
|
|
ENTRYPOINT ["/app/gopherss"]
|