Skip to content

Commit

Permalink
Revert "feat: update dockerfile with a few enhancement (bnb-chain#998)"
Browse files Browse the repository at this point in the history
This reverts commit 37b7ac7.
  • Loading branch information
acoshift committed Apr 17, 2023
1 parent c13fe3e commit c452e3e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 181 deletions.
45 changes: 9 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,17 @@ ADD . /go-ethereum
RUN cd /go-ethereum && go run build/ci.go install ./cmd/geth

# Pull Geth into a second stage deploy alpine container
FROM alpine:3.17

ARG BSC_USER=bsc
ARG BSC_USER_UID=1000
ARG BSC_USER_GID=1000

ENV BSC_HOME=/bsc
ENV HOME=${BSC_HOME}
ENV DATA_DIR=/data

ENV PACKAGES ca-certificates jq \
bash bind-tools tini \
grep curl sed

RUN apk add --no-cache $PACKAGES \
&& rm -rf /var/cache/apk/* \
&& addgroup -g ${BSC_USER_GID} ${BSC_USER} \
&& adduser -u ${BSC_USER_UID} -G ${BSC_USER} --shell /sbin/nologin --no-create-home -D ${BSC_USER} \
&& addgroup ${BSC_USER} tty \
&& sed -i -e "s/bin\/sh/bin\/bash/" /etc/passwd

RUN echo "[ ! -z \"\$TERM\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bash/bashrc

WORKDIR ${BSC_HOME}
FROM alpine:latest

RUN apk add --no-cache ca-certificates curl jq tini
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/

COPY docker-entrypoint.sh ./

RUN chmod +x docker-entrypoint.sh \
&& mkdir -p ${DATA_DIR} \
&& chown -R ${BSC_USER_UID}:${BSC_USER_GID} ${BSC_HOME} ${DATA_DIR}

VOLUME ${DATA_DIR}

USER ${BSC_USER_UID}:${BSC_USER_GID}

# rpc ws graphql
EXPOSE 8545 8546 8547 30303 30303/udp
ENTRYPOINT ["geth"]

# Add some metadata labels to help programatic image consumption
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""

ENTRYPOINT ["/sbin/tini", "--", "./docker-entrypoint.sh"]
LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.

.PHONY: geth android ios evm all test truffle-test clean
.PHONY: docker
.PHONY: geth-linux-arm geth-linux-arm64 geth-linux-arm5 geth-linux-arm6 geth-linux-arm7
.PHONY: geth android ios geth-cross evm all test truffle-test clean

GOBIN = ./build/bin
GO ?= latest
Expand Down Expand Up @@ -80,6 +78,3 @@ devtools:
env GOBIN= go install ./cmd/abigen
@type "solc" 2> /dev/null || echo 'Please install solc'
@type "protoc" 2> /dev/null || echo 'Please install protoc'

docker:
docker build --pull -t bnb-chain/bsc:latest -f Dockerfile .
54 changes: 0 additions & 54 deletions docker-compose.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions docker-entrypoint.sh

This file was deleted.

70 changes: 0 additions & 70 deletions docs/docker/README.md

This file was deleted.

0 comments on commit c452e3e

Please sign in to comment.