mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-10 22:13:47 +00:00
multi stage build / make target arg
This commit is contained in:
parent
bf468a81ec
commit
40ba2aad1c
1 changed files with 11 additions and 5 deletions
16
Dockerfile
16
Dockerfile
|
|
@ -1,12 +1,18 @@
|
||||||
FROM alpine:3.5
|
FROM alpine:3.5 as builder
|
||||||
|
|
||||||
ADD . /go-ethereum
|
ADD . /go-ethereum
|
||||||
|
ARG MAKE_TARGET=geth
|
||||||
RUN \
|
RUN \
|
||||||
apk add --update git go make gcc musl-dev linux-headers && \
|
apk add --update git go make gcc musl-dev linux-headers && \
|
||||||
(cd go-ethereum && make geth) && \
|
(cd go-ethereum && make $MAKE_TARGET) && \
|
||||||
cp go-ethereum/build/bin/geth /usr/local/bin/ && \
|
echo "Dockerfile builder stage finished."
|
||||||
apk del git go make gcc musl-dev linux-headers && \
|
# cp go-ethereum/build/bin/geth /usr/local/bin/ && \
|
||||||
rm -rf /go-ethereum && rm -rf /var/cache/apk/*
|
# apk del git go make gcc musl-dev linux-headers && \
|
||||||
|
# rm -rf /go-ethereum && rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
FROM alpine:3.5
|
||||||
|
|
||||||
|
COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/
|
||||||
|
|
||||||
EXPOSE 8545
|
EXPOSE 8545
|
||||||
EXPOSE 30303
|
EXPOSE 30303
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue