Fix dockerfile

This commit is contained in:
Marcus Noble 2020-10-18 11:01:47 +01:00
parent 9a769fb963
commit bc8649fac3

View File

@ -7,16 +7,12 @@ ARG TARGETARCH
WORKDIR /app/ WORKDIR /app/
RUN apk update && apk add --no-cache --update gcc musl-dev git && adduser -D -g '' gopher && apk add -U --no-cache ca-certificates RUN apk update && apk add --no-cache --update gcc musl-dev git && adduser -D -g '' gopher && apk add -U --no-cache ca-certificates
RUN go get github.com/mattn/go-sqlite3
ADD go.mod go.sum ./ ADD go.mod go.sum ./
RUN go mod download RUN go mod download
ADD . . ADD . .
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o gopherss . RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o gopherss .
FROM --platform=${TARGETPLATFORM:-linux/amd64} scratch COPY ./views /app/
WORKDIR /app/
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /app/gopherss /app/gopherss
COPY ./views /app/views/
USER gopher
ENTRYPOINT ["/app/gopherss"] ENTRYPOINT ["/app/gopherss"]