forked from parca-dev/parca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.go.dev
47 lines (35 loc) · 1.58 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
# Designed to only used by Tilt to iterate faster on the API.
FROM docker.io/golang:1.19.3-alpine@sha256:8bd8a4b55b233ea77a81250f83637553ef9e3348c5a0cc3ce440c5d45bf7d51d AS builder
# renovate: datasource=go depName=github.com/go-delve/delve
ARG DLV_VERSION=v1.9.1
# renovate: datasource=go depName=github.com/grpc-ecosystem/grpc-health-probe
ARG GRPC_HEALTH_PROBE_VERSION=v0.4.14
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.19.3-alpine@sha256:8bd8a4b55b233ea77a81250f83637553ef9e3348c5a0cc3ce440c5d45bf7d51d
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", "--"]