Skip to content

Commit

Permalink
Merge pull request #5201 from filecoin-project/chore/tanlang/pre-down…
Browse files Browse the repository at this point in the history
…load-go-mod

Chore/tanlang/pre download go mod
  • Loading branch information
hunjixin authored Aug 19, 2022
2 parents 64c38fa + 5452900 commit b4084b3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
38 changes: 38 additions & 0 deletions docker/script/install_mod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#! bash
# this script is used to pre download and install golang dependencies from source repos

go env -w GOPROXY=https://goproxy.io,direct

repos=(\
https://github.com/filecoin-project/venus.git \
https://github.com/filecoin-project/venus-messager.git \
https://github.com/ipfs-force-community/venus-gateway.git \
https://github.com/filecoin-project/venus-auth.git \
https://github.com/filecoin-project/venus-miner.git \
https://github.com/filecoin-project/venus-wallet.git \
https://github.com/filecoin-project/venus-market.git \
)

mkdir -p /gomod/
cd /gomod/

function checkout {
git clone $1 --depth 1
}

for repo in ${repos[@]}
do checkout $repo --depth 1
done

for directory in $(ls)
do
if [ -d $directory ]
then
cd $directory
go mod download -x
cd ..
echo $directory
fi
done

rm -rf /gomod
10 changes: 4 additions & 6 deletions docker/venus-buildenv.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ FROM golang:1.17 AS build-env

RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list


# download dependence
RUN apt-get update -y
RUN apt-get install -y \
mesa-opencl-icd ocl-icd-opencl-dev bzr jq pkg-config hwloc libhwloc-dev
RUN apt-get install -y \
gcc clang build-essential
RUN apt-get install -y \
make ncftp git curl wget
mesa-opencl-icd ocl-icd-opencl-dev bzr jq pkg-config hwloc libhwloc-dev gcc clang build-essential make ncftp git curl wget

ADD docker/script/ /script/
RUN bash /script/install_mod.sh

0 comments on commit b4084b3

Please sign in to comment.