Skip to content

Commit

Permalink
update docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc committed Aug 14, 2024
1 parent 7959156 commit 5677138
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/paritytech/ci-unified:latest as builder
FROM docker.io/paritytech/ci-unified:latest AS builder

WORKDIR /acala
COPY . .
Expand All @@ -8,24 +8,27 @@ RUN cargo build --locked --release

# =============

FROM docker.io/parity/base-bin:latest
FROM phusion/baseimage:noble-1.0.0
LABEL maintainer="hello@acala.network"

RUN useradd -m -u 1000 -U -s /bin/sh -d /acala acala

COPY --from=builder /acala/target/release/acala /usr/local/bin

USER root
RUN useradd -m -u 1000 -U -s /bin/sh -d /acala acala && \
mkdir -p /acala/data /acala/.local/share && \
chown -R acala:acala /acala/data && \
ln -s /acala/data /acala/.local/share/acala && \
# unclutter and minimize the attack surface
rm -rf /usr/bin /usr/sbin && \
# check if executable works in this container
# checks
RUN ldd /usr/local/bin/acala && \
/usr/local/bin/acala --version

# Shrinking
RUN rm -rf /usr/lib/python* && \
rm -rf /usr/sbin /usr/share/man

USER acala

EXPOSE 30333 9933 9944 9615
EXPOSE 30333 9933 9615

RUN mkdir /acala/data

VOLUME ["/acala/data"]

ENTRYPOINT ["/usr/local/bin/acala"]
ENTRYPOINT ["/usr/local/bin/acala"]

0 comments on commit 5677138

Please sign in to comment.