ente/cli/Dockerfile
Manav Rathi 0ea408379a
[server] [cli] Fix docker "FROM AS" case warnings
With the latest Docker update (27.0.3), it now warns about the "FROM" and "AS"
in the Dockerfile not matching. E.g. when building the server docker image:

> WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)
2024-07-12 11:19:37 +05:30

25 lines
579 B
Docker

FROM golang:1.20-alpine3.17 AS builder
RUN apk add --no-cache gcc musl-dev git build-base pkgconfig libsodium-dev
ENV GOOS=linux
WORKDIR /etc/ente/
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
# the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled
RUN --mount=type=cache,target=/root/.cache/go-build \
go build -o ente-cli main.go
FROM alpine:3.17
RUN apk add libsodium-dev
COPY --from=builder /etc/ente/ente-cli .
ARG GIT_COMMIT
ENV GIT_COMMIT=$GIT_COMMIT
CMD ["./ente-cli"]