dockerfile: optimize on size and network call
- merge multiple steps to reduce number of layers - run make clean to reduce layer size - run cargo clean - merge multiple ARG into single step Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
This commit is contained in:
@@ -6,16 +6,16 @@ WORKDIR /build
|
||||
RUN apk update && \
|
||||
apk add \
|
||||
git \
|
||||
rust
|
||||
|
||||
RUN apk add cargo
|
||||
rust \
|
||||
cargo
|
||||
|
||||
ARG TXOO_GIT_HASH=528fa92e5def1b6cc19127f2242137bf6f13550d
|
||||
ARG TXOO_REPO=https://gitlab.com/lightning-signer/txoo.git
|
||||
RUN git clone --recurse-submodules $TXOO_REPO
|
||||
RUN cd txoo && \
|
||||
git checkout $TXOO_GIT_HASH && \
|
||||
cargo build --release -p txood
|
||||
cargo install --path ./txood --bin txood --profile release --root /usr/local/ && \
|
||||
cargo clean
|
||||
|
||||
# txoo runner
|
||||
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner
|
||||
@@ -32,7 +32,7 @@ RUN apk update && \
|
||||
libev-dev \
|
||||
curl-dev
|
||||
|
||||
COPY --from=builder /build/txoo/target/release/txood /usr/bin/txood
|
||||
COPY --from=builder /usr/local/bin/txood /usr/bin/txood
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
Reference in New Issue
Block a user