Skip to content

Commit df50ee0

Browse files
committed
refactor: simplify Dockerfile by removing prebuilt binary stage and consolidating builder selection
1 parent 4737900 commit df50ee0

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

docker-compose/lps/Dockerfile

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
ARG USE_PREBUILT=source
2-
ARG TARGETARCH=amd64
3-
4-
# Builder stage for compiling from source
5-
FROM --platform=linux/${TARGETARCH} golang:1.23.8@sha256:e54daaadd35ebb90fc1404ecdc6eb7338ae13555f71a71856ad96976ae084e44 AS builder-source
1+
FROM --platform=linux/amd64 golang:1.23.8@sha256:e54daaadd35ebb90fc1404ecdc6eb7338ae13555f71a71856ad96976ae084e44 AS builder
62

73
ARG COMMIT_HASH
84
ARG COMMIT_TAG
@@ -23,19 +19,9 @@ RUN if [[ "$LPS_STAGE" != "regtest" ]]; \
2319
else make build; \
2420
fi
2521

26-
# Builder stage for pre-built binary
27-
FROM --platform=linux/${TARGETARCH} alpine:3.19.1@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b AS builder-prebuilt
28-
29-
WORKDIR /code
30-
COPY build/liquidity-provider-server /code/build/liquidity-provider-server
31-
32-
# Select the appropriate builder based on USE_PREBUILT arg
33-
FROM builder-${USE_PREBUILT} AS selected-builder
34-
35-
# Final stage
36-
FROM --platform=linux/${TARGETARCH} alpine:3.19.1@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b
22+
FROM --platform=linux/amd64 alpine:3.19.1@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b
3723

38-
COPY --from=selected-builder /code/build/liquidity-provider-server /usr/local/bin/liquidity-provider-server
24+
COPY --from=builder /code/build/liquidity-provider-server /usr/local/bin/liquidity-provider-server
3925

4026
ARG HOME="/home/lps"
4127
RUN adduser -u 1000 --home="$HOME" lps -D lps

0 commit comments

Comments
 (0)