fix docker

This commit is contained in:
HoraceZhang 2024-10-17 17:27:16 +08:00 committed by GitHub
parent 1095922045
commit b19b2c885a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 18 deletions

View File

@ -1,16 +1,6 @@
FROM golang:1.22.4-bullseye as build
# 构建
# git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git
# cd ceremonyclient
# curl -o Dockerfile https://raw.githubusercontent.com/lushdog/quil-docker/main/Dockerfile
# docker build -f Dockerfile --build-arg NODE_VERSION=1.4.19 --build-arg MAX_KEY_ID=13 -t quilibrium -t quilibrium:1.4.19 .
ARG NODE_VERSION
ENV GOEXPERIMENT=arenas
WORKDIR /opt/ceremonyclient
WORKDIR /opt/node
COPY . .
@ -20,9 +10,7 @@ RUN curl -o fetch.sh https://raw.githubusercontent.com/lushdog/quil-docker/refs/
RUN chmod +x node
WORKDIR /opt/ceremonyclient/client
RUN go build -o qclient ./main.go
WORKDIR /opt/node
RUN go install github.com/fullstorydev/grpcurl/cmd/grpcurl@v1.9.1
@ -30,11 +18,13 @@ FROM ubuntu:22.04
ENV GOEXPERIMENT=arenas
COPY --from=build /opt/ceremonyclient/node /usr/local/bin
COPY --from=build /opt/ceremonyclient/node.dgst /usr/local/bin
COPY --from=build /opt/ceremonyclient/node.dgst.sig.* /usr/local/bin
COPY --from=build /opt/node /usr/local/bin
COPY --from=build /opt/node.dgst /usr/local/bin
COPY --from=build /opt/node.dgst.sig.* /usr/local/bin
COPY --from=build /opt/ceremonyclient/client/qclient /usr/local/bin
COPY --from=build /opt/qclient /usr/local/bin
COPY --from=build /opt/qclient.dgst /usr/local/bin
COPY --from=build /opt/qclient.dgst.sig.* /usr/local/bin
COPY --from=build /go/bin/grpcurl /usr/local/bin

View File

@ -19,3 +19,26 @@ fetch() {
done
}
fetch
fetchQclient() {
files=$(curl https://releases.quilibrium.com/qclient-release | grep linux-amd64)
new_release=false
for file in $files; do
# 下载文件
if ! test -f "./$file"; then
curl "https://releases.quilibrium.com/$file" > "$file"
new_release=true
# 使用正则表达式匹配,替换掉前缀部分为 'node'
new_name=$(echo "$file" | sed 's/qclient-.*-linux-amd64/qclient/')
# 只有当文件名不同的时候才执行重命名
if [[ "$file" != "$new_name" ]]; then
mv "$file" "$new_name"
fi
fi
done
}
fetchQclient