forked from pyrra-dev/pyrra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
33 lines (25 loc) · 1.23 KB
/
Dockerfile.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
FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/golang:1.22.4-alpine as go-builder
# renovate: datasource=go depName=github.com/go-delve/delve
ARG DLV_VERSION=v1.21.0
# hadolint ignore=DL3018
RUN apk update && apk add --no-cache build-base
RUN go install "github.com/go-delve/delve/cmd/dlv@${DLV_VERSION}"
FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/busybox:1.36.1 as builder
ARG TARGETOS TARGETARCH TARGETVARIANT
WORKDIR /app
COPY dist dist
# NOTICE: See goreleaser.yml for the build paths.
RUN if [ "${TARGETARCH}" = 'amd64' ]; then \
cp "dist/pyrra_${TARGETOS}_${TARGETARCH}_${TARGETVARIANT:-v1}/pyrra" . ; \
elif [ "${TARGETARCH}" = 'arm' ]; then \
cp "dist/pyrra_${TARGETOS}_${TARGETARCH}_${TARGETVARIANT##v}/pyrra" . ; \
else \
cp "dist/pyrra_${TARGETOS}_${TARGETARCH}/pyrra" . ; \
fi
RUN chmod +x pyrra
FROM --platform="${TARGETPLATFORM:-linux/amd64}" docker.io/alpine:3.20.1 AS runner
WORKDIR /
COPY --chown=0:0 --from=builder /app/pyrra /usr/bin/pyrra
COPY --chown=0:0 --from=go-builder /go/bin/dlv /usr/bin/dlv
USER 65533
ENTRYPOINT ["/usr/bin/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "--continue", "--", "/usr/bin/pyrra"]