Skip to content

Commit

Permalink
delve support
Browse files Browse the repository at this point in the history
  • Loading branch information
skudasov committed Dec 16, 2024
1 parent d0b7af3 commit 02830e5
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 @@ -68,6 +75,8 @@ RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
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/
# Copy Delve debugger from build stage
COPY --from=buildgo /go/bin/dlv /usr/local/bin/dlv

COPY --from=buildplugins /go/bin/chainlink-feeds /usr/local/bin/
ENV CL_MEDIAN_CMD chainlink-feeds
Expand All @@ -92,6 +101,7 @@ ENV XDG_CACHE_HOME /home/${CHAINLINK_USER}/.cache
RUN mkdir -p ${XDG_CACHE_HOME}

EXPOSE 6688
EXPOSE 40000
ENTRYPOINT ["chainlink"]

HEALTHCHECK CMD curl -f http://localhost:6688/health || exit 1
Expand Down

0 comments on commit 02830e5

Please sign in to comment.