The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
woop/scripts/docker/Dockerfile

67 lines
1.8 KiB

ARG GOPATH_DEFAULT=/root/go
ARG SRC_PATH=src/github.com/woop-chain
FROM golang:1.19-bullseye as builder
ARG GOPATH_DEFAULT
ARG SRC_PATH
ENV GOPATH=${GOPATH_DEFAULT}
ENV GO111MODULE=on
ENV WIKI_PATH=${GOPATH}/${SRC_PATH}
ENV PACKAGES libgmp-dev libssl-dev curl git \
psmisc dnsutils jq make gcc g++ bash tig tree
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y $PACKAGES --no-install-recommends
WORKDIR ${WIKI_PATH}
RUN git clone https://github.com/woop-chain/woop.git woop \
&& git clone https://github.com/woop-chain/bls.git bls \
&& git clone https://github.com/woop-chain/mcl.git mcl \
&& git clone https://github.com/woop-chain/go-sdk.git go-sdk
WORKDIR ${WIKI_PATH}/woop
RUN make linux_static
# Pull woop into a second stage deploy alpine container
FROM alpine:3.16.0
ARG GOPATH_DEFAULT
ARG SRC_PATH
ARG WOOP_USER=woop
ARG WOOP_USER_UID=1000
ARG WOOP_USER_GID=1000
ENV WOOP_HOME=/woop
ENV HOME=${WOOP_HOME}
RUN apk add --no-cache bash bind-tools tini curl sed \
&& rm -rf /var/cache/apk/* \
&& addgroup -g ${WOOP_USER_GID} ${WOOP_USER} \
&& adduser -u ${WOOP_USER_UID} -G ${WOOP_USER} --shell /sbin/nologin --no-create-home -D ${WOOP_USER} \
&& addgroup ${WOOP_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 ${WOOP_HOME}
COPY --from=builder ${GOPATH_DEFAULT}/${SRC_PATH}/woop/bin/woop /usr/local/bin/
RUN chmod +x /usr/local/bin/woop \
&& mkdir -p /data \
&& chown -R ${WOOP_USER_UID}:${WOOP_USER_GID} ${WOOP_HOME} /data
VOLUME /data
USER ${WOOP_USER_UID}:${WOOP_USER_GID}
# default base port, rpc port and rest port
EXPOSE 9000/tcp 9500/tcp 9800/tcp 6000/tcp
ENTRYPOINT ["tini", "--"]
CMD ["woop", "-c", "woop.conf"]