Skip to content

Commit

Permalink
feat(docker): Add support for arm64 and amd64 builds for jemalloc (#4585
Browse files Browse the repository at this point in the history
)

* feat(docker): Add support for arm64 and amd64 builds for jemalloc

* feat(release): add arm64 plattform for docker containers
  • Loading branch information
muXxer authored Dec 31, 2024
1 parent 08c1ba5 commit 8f98781
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
with:
context: .
file: docker/iota-node/Dockerfile
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-node.outputs.tags }}
push: true
pull: true
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
with:
context: .
file: docker/iota-indexer/Dockerfile
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-indexer.outputs.tags }}
push: true
pull: true
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
with:
context: .
file: docker/iota-tools/Dockerfile
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-tools.outputs.tags }}
push: true
pull: true
Expand Down Expand Up @@ -294,7 +294,7 @@ jobs:
with:
context: .
file: docker/iota-graphql-rpc/Dockerfile
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-tools.outputs.tags }}
push: true
pull: true
Expand Down
16 changes: 13 additions & 3 deletions docker/iota-bridge-indexer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,19 @@ WORKDIR "$WORKDIR"
# Install runtime dependencies and tools
RUN apt update && apt install -y libpq5 ca-certificates curl

# Install jemalloc as the default allocator
RUN apt install -y libjemalloc-dev
ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so
# Install jemalloc as the default allocator used for memory profiling on supported
# architectures and create a symlink for the correct version based on the architecture
RUN ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "arm64" ]; then \
apt update && apt install -y libjemalloc-dev; \
ln -sf $(ldconfig -p | grep jemalloc | awk '{print $4}' | sort -u | head -n 1) /usr/lib/libjemalloc.so; \
else \
echo "Unsupported architecture: $ARCH. Only amd64 and arm64 are supported."; \
exit 1; \
fi

# Set LD_PRELOAD to the symlinked path
ENV LD_PRELOAD=/usr/lib/libjemalloc.so

COPY --from=builder /iota/bridge-indexer /usr/local/bin

Expand Down
16 changes: 13 additions & 3 deletions docker/iota-indexer-tidb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,19 @@ WORKDIR "$WORKDIR"
# Install runtime dependencies and tools
RUN apt update && apt install -y libpq5 ca-certificates curl

# Install jemalloc as the default allocator
RUN apt install -y libjemalloc-dev
ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so
# Install jemalloc as the default allocator used for memory profiling on supported
# architectures and create a symlink for the correct version based on the architecture
RUN ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "arm64" ]; then \
apt update && apt install -y libjemalloc-dev; \
ln -sf $(ldconfig -p | grep jemalloc | awk '{print $4}' | sort -u | head -n 1) /usr/lib/libjemalloc.so; \
else \
echo "Unsupported architecture: $ARCH. Only amd64 and arm64 are supported."; \
exit 1; \
fi

# Set LD_PRELOAD to the symlinked path
ENV LD_PRELOAD=/usr/lib/libjemalloc.so

COPY --from=builder /iota/iota-indexer /usr/local/bin

Expand Down
16 changes: 13 additions & 3 deletions docker/iota-indexer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,19 @@ WORKDIR "$WORKDIR"
# Install runtime dependencies and tools
RUN apt update && apt install -y libpq5 ca-certificates curl

# Install jemalloc as the default allocator
RUN apt install -y libjemalloc-dev
ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so
# Install jemalloc as the default allocator used for memory profiling on supported
# architectures and create a symlink for the correct version based on the architecture
RUN ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "arm64" ]; then \
apt update && apt install -y libjemalloc-dev; \
ln -sf $(ldconfig -p | grep jemalloc | awk '{print $4}' | sort -u | head -n 1) /usr/lib/libjemalloc.so; \
else \
echo "Unsupported architecture: $ARCH. Only amd64 and arm64 are supported."; \
exit 1; \
fi

# Set LD_PRELOAD to the symlinked path
ENV LD_PRELOAD=/usr/lib/libjemalloc.so

COPY --from=builder /iota/iota-indexer /usr/local/bin

Expand Down
16 changes: 13 additions & 3 deletions docker/iota-node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,19 @@ WORKDIR "$WORKDIR"
# Install runtime dependencies and tools
RUN apt update && apt install -y libpq5 ca-certificates curl

# Install jemalloc as the default allocator
RUN apt install -y libjemalloc-dev
ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so
# Install jemalloc as the default allocator used for memory profiling on supported
# architectures and create a symlink for the correct version based on the architecture
RUN ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "arm64" ]; then \
apt update && apt install -y libjemalloc-dev; \
ln -sf $(ldconfig -p | grep jemalloc | awk '{print $4}' | sort -u | head -n 1) /usr/lib/libjemalloc.so; \
else \
echo "Unsupported architecture: $ARCH. Only amd64 and arm64 are supported."; \
exit 1; \
fi

# Set LD_PRELOAD to the symlinked path
ENV LD_PRELOAD=/usr/lib/libjemalloc.so

COPY --from=builder /iota/iota-node /usr/local/bin

Expand Down

0 comments on commit 8f98781

Please sign in to comment.