Skip to content

Commit

Permalink
feat: reduce docker image size
Browse files Browse the repository at this point in the history
  • Loading branch information
MSevey committed Jul 10, 2024
1 parent a1a16be commit 4a8197a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,28 @@ RUN sed -i '/wasmd start/s/^/#/' init.sh

RUN bash init.sh

# Stage 2: Create a minimal runtime image
FROM debian:bullseye-slim

# Install only the necessary runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
curl \
jq \
ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /root

# Copy the wasmd binary from the build stage
COPY --from=build-env /go/bin/wasmd /usr/bin/wasmd

# Copy the .wasmd directory from the build stage
COPY --from=build-env /root/.wasmd /root/.wasmd

# Ensure the wasmd binary is executable
RUN chmod +x /usr/bin/wasmd

EXPOSE 36657 36656 9290

# Keep the container running
Expand Down

0 comments on commit 4a8197a

Please sign in to comment.