Skip to content

Commit

Permalink
build: merge heaptrack dockerfile with production dockerfile (#1682)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo Delgado authored Apr 18, 2023
1 parent 76ad673 commit 104926d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 73 deletions.
32 changes: 31 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BUILD IMAGE ------------------------------------------------------------------
# BUILD NIM APP ----------------------------------------------------------------

FROM alpine:edge AS nim-build

Expand Down Expand Up @@ -52,5 +52,35 @@ COPY --from=nim-build /app/migrations/ /app/migrations/
RUN ln -sv /usr/local/bin/$MAKE_TARGET /usr/bin/wakunode

ENTRYPOINT ["/usr/bin/wakunode"]

# By default just show help if called without arguments
CMD ["--help"]


# DEBUG IMAGE ------------------------------------------------------------------

# Build debug tools: heaptrack
FROM alpine:edge AS heaptrack-build

RUN apk update
RUN apk add -- gdb git g++ make cmake zlib-dev boost-dev libunwind-dev
RUN git clone https://github.com/KDE/heaptrack.git /heaptrack

WORKDIR /heaptrack/build
RUN cmake -DCMAKE_BUILD_TYPE=Release ..
RUN make -j$(nproc)


# Debug image
FROM prod AS debug

RUN apk add --no-cache gdb

# Add heaptrack
COPY --from=heaptrack-build /heaptrack/build/ /heaptrack/build/
COPY --from=heaptrack-build /usr/lib/ /usr/lib/

ENV LD_LIBRARY_PATH=/heaptrack/build/lib/heaptrack/
RUN ln -s /heaptrack/build/bin/heaptrack /usr/local/bin/heaptrack

ENTRYPOINT ["/heaptrack/build/bin/heaptrack", "/usr/bin/wakunode"]
72 changes: 0 additions & 72 deletions Dockerfile_with_heaptrack

This file was deleted.

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,14 @@ DOCKER_IMAGE_NIMFLAGS ?= -d:chronicles_colors:none -d:insecure
docker-image: MAKE_TARGET ?= wakunode2
docker-image: DOCKER_IMAGE_TAG ?= $(MAKE_TARGET)-$(GIT_VERSION)
docker-image: DOCKER_IMAGE_NAME ?= statusteam/nim-waku:$(DOCKER_IMAGE_TAG)
docker-image: DOCKER_IMAGE_TARGET ?= prod
docker-image:
docker build \
--build-arg="MAKE_TARGET=$(MAKE_TARGET)" \
--build-arg="NIMFLAGS=$(DOCKER_IMAGE_NIMFLAGS)" \
--build-arg="EXPERIMENTAL=$(EXPERIMENTAL)" \
--label="commit=$(GIT_VERSION)" \
--target $(DOCKER_IMAGE_TARGET) \
--tag $(DOCKER_IMAGE_NAME) .

docker-push:
Expand Down

0 comments on commit 104926d

Please sign in to comment.