-
Notifications
You must be signed in to change notification settings - Fork 340
/
Dockerfile.debug
54 lines (34 loc) · 1.15 KB
/
Dockerfile.debug
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
49
50
51
52
53
FROM golang:1.22-alpine3.19 as go-builder
ARG LINK_STATICALLY
# Set working directory
WORKDIR /app
COPY go.mod go.sum* ./
RUN go mod download
COPY . .
# Install system dependencies required for your application and Delve
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3
RUN apk add --no-cache $PACKAGES
# Install Delve
RUN go install github.com/go-delve/delve/cmd/dlv@latest
# Build (with out optimize so it doesn't interfere with debugging but currently not working)
# RUN CGO_ENABLED=0 go build -gcflags="all=-N -l" -o /app/go-debugger .
# Build
RUN make build-debug
# Use a small base image
FROM alpine:3.17
# Install runtime dependencies
RUN apk add curl jq bash vim
# Copy the compiled binary from the builder
COPY --from=go-builder /app/build/dymd /usr/local/bin/
# Copy Delve from the builder
COPY --from=go-builder /go/bin/dlv /usr/local/bin/dlv
# Set working directory
WORKDIR /app
# Copy scripts
COPY scripts/* ./scripts/
# Make scripts executable
RUN chmod +x ./scripts/*.sh
ENV KEY_NAME=local-user
ENV MONIKER_NAME=local
# Expose ports (application port, Delve port)
EXPOSE 36657 36656 8090 8091 1318 9545 9546 4000