-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
35 lines (18 loc) · 931 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM cgr.dev/chainguard/go:latest AS builder
WORKDIR /app
COPY sourcecode-parser .
ARG POSTHOG_WEB_ANALYTICS
ARG PROJECT_COMMIT
ENV POSTHOG_API_KEY=$POSTHOG_WEB_ANALYTICS
ARG PROJECT_VERSION
RUN echo "Building version ${PROJECT_VERSION} with commit ${PROJECT_COMMIT}"
RUN go mod download
RUN go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.Version=${PROJECT_VERSION} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.GitCommit=${PROJECT_COMMIT} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/analytics.PublicKey=${POSTHOG_API_KEY}" -v -o pathfinder .
FROM cgr.dev/chainguard/wolfi-base:latest
WORKDIR /app
COPY --from=builder /app/pathfinder /usr/bin/pathfinder
COPY entrypoint.sh /usr/bin/entrypoint.sh
RUN chmod +x /usr/bin/pathfinder
RUN chmod +x /usr/bin/entrypoint.sh
LABEL maintainer="[email protected]"
ENTRYPOINT ["/usr/bin/entrypoint.sh"]