forked from parca-dev/parca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.go.dev
48 lines (36 loc) · 1.6 KB
/
Dockerfile.go.dev
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
36
37
38
39
40
41
42
43
44
45
46
47
48
# vim: ft=dockerfile
# Designed to only used by Tilt to iterate faster on the API.
FROM docker.io/golang:1.23.3-alpine@sha256:c694a4d291a13a9f9d94933395673494fc2cc9d4777b85df3a7e70b3492d3574 AS builder
# renovate: datasource=go depName=github.com/go-delve/delve
ARG DLV_VERSION=v1.23.1
# renovate: datasource=go depName=github.com/grpc-ecosystem/grpc-health-probe
ARG GRPC_HEALTH_PROBE_VERSION=v0.4.35
WORKDIR /app
# hadolint ignore=DL3018
RUN apk update && apk add --no-cache build-base
RUN go install "github.com/go-delve/delve/cmd/dlv@${DLV_VERSION}"
# hadolint ignore=DL3059
RUN go install "github.com/grpc-ecosystem/grpc-health-probe@${GRPC_HEALTH_PROBE_VERSION}"
COPY go.mod go.sum /app/
RUN go mod download -modcacherw
# Create a dummy ui package to convience go compiler.
RUN mkdir -p /app/ui/packages/app/web/build && \
touch /app/ui/packages/app/web/build/index.html && \
printf 'package ui\n \
import "embed"\n\
//go:embed packages/app/web/build\n\
var FS embed.FS\n'\
> ./ui/ui.go
COPY ./cmd /app/cmd
COPY ./pkg /app/pkg
COPY ./proto /app/proto
COPY ./gen /app/gen
# goreleaser build --single-target
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags="all=-N -l" -o parca ./cmd/parca
FROM docker.io/golang:1.23.3-alpine@sha256:c694a4d291a13a9f9d94933395673494fc2cc9d4777b85df3a7e70b3492d3574
COPY --from=builder /go/bin/dlv /
COPY --from=builder /go/bin/grpc-health-probe /
COPY --from=builder /app/parca /parca
COPY parca.yaml /parca.yaml
EXPOSE 7070
ENTRYPOINT ["/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "--continue", "--"]