Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD: generator docker image build files #186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions ci/docker/Dockerfile-aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM ubuntu:18.04
MAINTAINER [email protected]
ENV DEBIAN_FRONTEND=noninteractive \
PIP_DEFAULT_TIMEOUT=600 \
PIP_FIND_LINKS="https://pypi.doubanio.com https://pypi.tuna.tsinghua.edu.cn"
ARG FISCO_BCOS_VERSION=v2.9.1
ARG FISCO_BCOS_PKG=fisco-bcos-aarch64.tar.gz

RUN apt-get update -q \
&& apt-get install -qy sudo git python-pip curl wget \
&& pip install -i https://mirrors.cloud.tencent.com/pypi/simple -U pip \
&& pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple

RUN git clone --depth=1 https://gitee.com/FISCO-BCOS/generator.git /opt/generator \
&& cd /opt/generator \
&& bash ./scripts/install.sh

RUN cd /opt/generator/meta \
&& wget -t 0 https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/$FISCO_BCOS_VERSION/$FISCO_BCOS_PKG \
&& tar zxvf $FISCO_BCOS_PKG \
&& ./fisco-bcos -v \
&& rm $FISCO_BCOS_PKG

RUN apt-get install -qy zlib1g-dev \
&& cd /usr/local/src \
&& wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/FISCO-BCOS/FISCO-BCOS/deps/tassl_1.0.2-5d2100.tar.gz \
&& tar zxvf tassl_1.0.2-5d2100.tar.gz \
&& cd TASSL-5d2100b378063bc9ffce0bb703784ab6053848ce \
&& chmod +x ./config \
&& chmod +x ./util/* \
&& ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib \
&& make -j \
&& make install \
&& mkdir ~/.fisco \
&& cp /usr/local/ssl/bin/openssl ~/.fisco/tassl \
&& ~/.fisco/tassl version \
&& rm /usr/local/src/* -rf

RUN apt-get autoremove -y \
&& apt-get autoclean \
&& rm /var/lib/apt/lists/* -rf

WORKDIR /opt/generator
30 changes: 30 additions & 0 deletions ci/docker/Dockerfile-amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:18.04
MAINTAINER [email protected]
ENV DEBIAN_FRONTEND=noninteractive \
PIP_DEFAULT_TIMEOUT=600 \
PIP_FIND_LINKS="https://pypi.doubanio.com https://pypi.tuna.tsinghua.edu.cn"
ARG FISCO_BCOS_VERSION=v2.9.1
ARG FISCO_BCOS_PKG=fisco-bcos.tar.gz

RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
&& apt-get update -q \
&& apt-get install -qy sudo git python-pip curl wget \
&& pip install -i https://mirrors.cloud.tencent.com/pypi/simple -U pip \
&& pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple

RUN git clone --depth=1 https://github.com/FISCO-BCOS/generator.git /opt/generator \
&& cd /opt/generator \
&& bash ./scripts/install.sh

RUN cd /opt/generator/meta \
&& wget -t 0 https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/$FISCO_BCOS_VERSION/$FISCO_BCOS_PKG \
&& tar zxvf $FISCO_BCOS_PKG \
&& rm $FISCO_BCOS_PKG -f \
/opt/generator/meta/fisco-bcos -v

RUN apt-get autoremove -y \
&& apt-get autoclean \
&& rm /var/lib/apt/lists/* -rf

WORKDIR /opt/generator
27 changes: 27 additions & 0 deletions ci/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# FISCO BCOS GENERATOR 容器镜像

镜像制作过程中需要从 github 下载内容,如遇网络问题导致失败,请重试。第一次制作的耗时很长,请耐心等待。

## x86_64 平台

```
docker build -f Dockerfile-amd64 -t fisco-bcos-generator .
```

## aarch64 平台

```
docker build -f Dockerfile-aarch64 -t fisco-bcos-generator .
```

## 制作成功后,可使用 docker compose 启动一个持久容器

```
docker-compose up -d || docker compose up -d
```

## 进入容器执行 generator 相关操作

```
docker exec -it fisco-bcos-generator bash
```
14 changes: 14 additions & 0 deletions ci/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "2"

services:
generator:
image: fisco-bcos-generator
container_name: fisco-bcos-generator
restart: always
working_dir: /opt/fisco-bcos-deploy
volumes:
- "/opt/fisco-bcos-deploy:/opt/fisco-bcos-deploy"
entrypoint:
- tail
- -f
- /dev/null