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 Feb 25, 2024
1 parent 44162c8 commit c91f541
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 179 deletions.
42 changes: 5 additions & 37 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,17 @@ ENV GOAMD64=v3
ADD . /go-ethereum

# For blst
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
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 gcc

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"]

ENTRYPOINT ["/sbin/tini", "--", "./docker-entrypoint.sh"]
LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,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 c91f541

Please sign in to comment.