制作geth 的镜像

来源:互联网 发布:钱规则网络剧 编辑:程序博客网 时间:2024/05/02 21:44

1 写Dockerfile

mkdir blccd blcvim DockerfileFROM ubuntu:16.04RUN  apt-get update \     && apt-get install software-properties-common -y \     && add-apt-repository -y ppa:ethereum/ethereum \     && apt-get update \     && apt-get install ethereum -y

2 构建镜像

sudo docker  build -t node:node1 .
flq1@ubuntu:~/blc$ sudo docker build -t node:node1 .Sending build context to Docker daemon 2.048 kBStep 1/2 : FROM ubuntu:16.04 ---> 20c44cd7596fStep 2/2 : RUN apt-get update      && apt-get install software-properties-common -y      && add-apt-repository -y ppa:ethereum/ethereum      && apt-get update      && apt-get install ethereum -y ---> Using cache ---> c4feb44697edSuccessfully built c4feb44697edflq1@ubuntu:~/blc$ sudo docker imagesREPOSITORY           TAG                 IMAGE ID            CREATED             SIZEnode                 node1               c4feb44697ed        4 hours ago         376 MB

3 用镜像创建容器

flq1@ubuntu:~/blc$ sudo docker run -it node:node1 /bin/bashroot@6b684add4ad8:/# 
原创粉丝点击