1
0
mirror of https://github.com/ebosas/microservices.git synced 2025-06-06 22:16:11 +02:00
microservices/cache.Dockerfile

14 lines
381 B
Docker
Raw Permalink Normal View History

2021-11-02 16:44:51 +02:00
# FROM golang:1.17-alpine AS cache
# AWS CodeBuild fails due to Docker's pull rate limit, using ECR.
2021-11-02 16:44:51 +02:00
FROM public.ecr.aws/bitnami/golang:1.17 AS cache
2021-10-10 18:49:39 +03:00
WORKDIR /go/src/app
2021-11-02 16:55:29 +02:00
COPY go.* ./
2021-10-10 18:49:39 +03:00
COPY internal ./internal
RUN go mod download
2021-11-02 16:55:29 +02:00
COPY cmd/cache ./
2021-10-10 18:49:39 +03:00
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-s' -o cache .
FROM scratch
COPY --from=cache /go/src/app/cache /cache
CMD ["/cache"]