Skip to content

Commit 68c3f1e

Browse files
authored
update Dockerfile (#95)
* update Dockerfile 1. 利用本地资源build 镜像 缩短时间 2. 获取get_buildchain.sh 的url不稳定,更换获得build_chain.sh的方式 3. 防止重复git clone * update dockerfile update * update Dockerfile update dockerfile * update Dockerfile update * update Dockerfile * update Dockerfile update Co-authored-by: jimmyshi <417711026@qq.com>
1 parent 5413695 commit 68c3f1e

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@ FROM python:3.7-alpine
22

33
LABEL 99kies 1290017556@qq.com https://github.com/99kies
44

5+
COPY . /python-sdk
6+
57
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
68
apk update && \
7-
apk add --no-cache git gcc g++ python python-dev py-pip mysql-dev openssl bash linux-headers libffi-dev openssl-dev curl wget && \
9+
apk add --no-cache gcc g++ python python-dev py-pip openssl bash linux-headers libffi-dev openssl-dev curl wget && \
810
bash && \
911
export PATH=/root/.local/bin/:$PATH && \
10-
cd ~ && mkdir -p fisco && cd fisco && \
11-
curl -Ls https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/get_buildchain.sh > get_buildchain.sh && chmod u+x get_buildchain.sh && \
12-
bash get_buildchain.sh && chmod u+x build_chain.sh && \
12+
cd /python-sdk && \
13+
curl -LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/$(curl -s https://api.github.com/repos/FISCO-BCOS/FISCO-BCOS/releases | grep "\"v2\.[0-9]\.[0-9]\"" | sort -u | tail -n 1 | cut -d \" -f 4)/build_chain.sh && chmod u+x build_chain.sh && \
1314
bash build_chain.sh -l "127.0.0.1:4" -p 30300,20200,8545 && \
14-
cd / && \
15-
git clone https://github.com/FISCO-BCOS/python-sdk && \
16-
cd python-sdk && \
1715
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple --user && \
1816
bash init_env.sh -i && \
19-
cp ~/fisco/nodes/127.0.0.1/sdk/* bin/ && \
17+
cp /python-sdk/nodes/127.0.0.1/sdk/* bin/ && \
2018
ln -s /root/.local/bin/register-python-argcomplete /bin/register-python-argcomplete && \
2119
echo "eval \"\$(register-python-argcomplete ./console.py)\"" >> ~/.bashrc && \
20+
echo "eval \"/python-sdk/nodes/127.0.0.1/start_all.sh\"" >> ~/.bashrc && \
2221
rm /var/cache/apk/*
2322

2423
WORKDIR /python-sdk

0 commit comments

Comments
 (0)