Commit 604946b9 authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

update: dockerfile

parent 2a731941
Pipeline #673 canceled with stages
FROM golang:1.19-alpine AS base
# Set up dependencies
ENV PACKAGES git openssh-client build-base
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# Install dependencies
RUN apk add --update $PACKAGES
# Add source files
RUN mkdir -p ./witness
COPY ./ ./witness/
RUN go env -w GOPROXY="https://goproxy.cn,direct"
RUN git clone git@code.wuban.net.cn:odysseus/odysseus-protocol.git
FROM base AS build
RUN cd witness && go mod tidy && make
FROM alpine
WORKDIR /root
COPY ./config.toml ./config.toml
COPY --from=build /witness /usr/bin/witness
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod u+x /usr/local/bin/entrypoint.sh
EXPOSE 20000 20011 20012
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
\ No newline at end of file
#! /bin/sh
# exit script on any error
set -e
echo "runing witness"
/usr/bin/witness >> /root/witness.log 2>&1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment