Skip to content

Commit

Permalink
delve support (#15713)
Browse files Browse the repository at this point in the history
* delve support

* remove exposed port

* move dlv layer for better caching
  • Loading branch information
skudasov authored Dec 18, 2024
1 parent a744ed6 commit 7bcc81e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ COMMIT_SHA ?= $(shell git rev-parse HEAD)
VERSION = $(shell jq -r '.version' package.json)
GO_LDFLAGS := $(shell tools/bin/ldflags)
GOFLAGS = -ldflags "$(GO_LDFLAGS)"
GCFLAGS = -gcflags "$(GO_GCFLAGS)"

.PHONY: install
install: install-chainlink-autoinstall ## Install chainlink and all its dependencies.
Expand Down Expand Up @@ -38,7 +39,7 @@ docs: ## Install and run pkgsite to view Go docs

.PHONY: install-chainlink
install-chainlink: operator-ui ## Install the chainlink binary.
go install $(GOFLAGS) .
go install $(GCFLAGS) $(GOFLAGS) .

.PHONY: install-chainlink-cover
install-chainlink-cover: operator-ui ## Install the chainlink binary with cover flag.
Expand Down
12 changes: 11 additions & 1 deletion plugins/chainlink.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ RUN go mod download
# Env vars needed for chainlink build
ARG COMMIT_SHA

# Flags for Go Delve debugger
ARG GO_GCFLAGS

COPY . .

RUN apt-get update && apt-get install -y jq

# Install Delve for debugging
RUN go install github.com/go-delve/delve/cmd/dlv@latest

# Build the golang binaries
RUN make install-chainlink
RUN make GO_GCFLAGS="${GO_GCFLAGS}" install-chainlink

# Install medianpoc binary
RUN make install-medianpoc
Expand Down Expand Up @@ -52,6 +58,7 @@ WORKDIR /chainlink-starknet/relayer
COPY --from=buildgo /chainlink-starknet/relayer .
RUN go install ./pkg/chainlink/cmd/chainlink-starknet


# Final image: ubuntu with chainlink binary
FROM ubuntu:20.04

Expand All @@ -65,6 +72,9 @@ RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& apt-get update && apt-get install -y postgresql-client-16 \
&& apt-get clean all

# Copy Delve debugger from build stage
COPY --from=buildgo /go/bin/dlv /usr/local/bin/dlv

COPY --from=buildgo /go/bin/chainlink /usr/local/bin/
COPY --from=buildgo /go/bin/chainlink-medianpoc /usr/local/bin/
COPY --from=buildgo /go/bin/chainlink-ocr3-capability /usr/local/bin/
Expand Down

0 comments on commit 7bcc81e

Please sign in to comment.