Skip to content

Commit 8673f0d

Browse files
author
Gustavo Maronato
committed
Add missing paths to dockerfile
1 parent de3da93 commit 8673f0d

File tree

1 file changed

+54
-52
lines changed

1 file changed

+54
-52
lines changed

Dockerfile

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,54 @@
1-
# Load golang image
2-
FROM golang:1.21-alpine as builder
3-
4-
RUN apk add make
5-
6-
ARG VERSION=undefined
7-
8-
WORKDIR /go/src/app
9-
10-
# Set our build environment
11-
ENV GOCACHE=/tmp/.go-build-cache
12-
# This variable communicates to the service that it's running inside
13-
# a docker container.
14-
ENV ENV_DOCKER=true
15-
16-
# Copy dockerignore files
17-
COPY .dockerignore ./
18-
19-
# Install go deps using the cache
20-
COPY go.mod go.sum ./
21-
RUN --mount=type=cache,target=/tmp/.go-build-cache \
22-
go mod download -x
23-
24-
COPY Makefile ./
25-
26-
# Copy source files
27-
COPY main.go ./
28-
COPY cmd cmd
29-
COPY internal internal
30-
31-
# Build it
32-
RUN --mount=type=cache,target=/tmp/.go-build-cache \
33-
make build VERSION=$VERSION
34-
35-
# Now create a new image with just the binary
36-
FROM gcr.io/distroless/static-debian11:nonroot
37-
38-
WORKDIR /app
39-
40-
COPY urns.yml /app/urns.yml
41-
42-
# Set our runtime environment
43-
ENV ENV_DOCKER=true
44-
45-
COPY --from=builder /go/src/app/finger /usr/local/bin/finger
46-
47-
HEALTHCHECK CMD [ "finger", "healthcheck" ]
48-
49-
EXPOSE 8080
50-
51-
ENTRYPOINT [ "finger" ]
52-
CMD [ "serve" ]
1+
# Load golang image
2+
FROM golang:1.21-alpine as builder
3+
4+
RUN apk add make
5+
6+
ARG VERSION=undefined
7+
8+
WORKDIR /go/src/app
9+
10+
# Set our build environment
11+
ENV GOCACHE=/tmp/.go-build-cache
12+
# This variable communicates to the service that it's running inside
13+
# a docker container.
14+
ENV ENV_DOCKER=true
15+
16+
# Copy dockerignore files
17+
COPY .dockerignore ./
18+
19+
# Install go deps using the cache
20+
COPY go.mod go.sum ./
21+
RUN --mount=type=cache,target=/tmp/.go-build-cache \
22+
go mod download -x
23+
24+
COPY Makefile ./
25+
26+
# Copy source files
27+
COPY main.go ./
28+
COPY cmd cmd
29+
COPY internal internal
30+
COPY webfingers webfingers
31+
COPY handler handler
32+
33+
# Build it
34+
RUN --mount=type=cache,target=/tmp/.go-build-cache \
35+
make build VERSION=$VERSION
36+
37+
# Now create a new image with just the binary
38+
FROM gcr.io/distroless/static-debian11:nonroot
39+
40+
WORKDIR /app
41+
42+
COPY urns.yml /app/urns.yml
43+
44+
# Set our runtime environment
45+
ENV ENV_DOCKER=true
46+
47+
COPY --from=builder /go/src/app/finger /usr/local/bin/finger
48+
49+
HEALTHCHECK CMD [ "finger", "healthcheck" ]
50+
51+
EXPOSE 8080
52+
53+
ENTRYPOINT [ "finger" ]
54+
CMD [ "serve" ]

0 commit comments

Comments
 (0)