制作一个节点的镜像

来源:互联网 发布:手机视频播放网页源码 编辑:程序博客网 时间:2024/05/22 00:11

root@QKTEST21191:/home/ucsmy# docker run -it –name ubueth -p 8020:8020 ebcd9d4fca80
然后需要更新一下包

apt-get update

准备工作

apt-get install python-software-properties apt-get install software-properties-common apt-get  install  vim 

安装geth

 add-apt-repository -y ppa:ethereum/ethereum apt-get update apt-get install ethereum
mkdir private-gethcd private-gethvim genesis.json{    "config": {        "chainId": 12345,        "homesteadBlock": 0,        "eip155Block": 0,        "eip158Block": 0    },    "coinbase" : "0x0000000000000000000000000000000000000000",    "difficulty" : "0x400",    "extraData" : "0x123456",    "gasLimit" : "0xffffffff",    "nonce" : "0x0000000000000042",    "mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",    "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",    "timestamp" : "0x00",    "alloc": { }}

初始化geth并且进入geth

geth --datadir ./data init genesis.jsongeth --identity "haha"  --nodiscover  --datadir ./data --networkid 12345  --rpcapi "db,eth,net,web3" --port 2221 --rpcport 3331 console

先跑一个容器

docker run –name test1 -it daocloud.io/ubuntu /bin/bash

然后在容器里面更新一下

root@56af07d454f5:/# apt-get update -y
1
1
退出容器,commit一下

ucsmy@QKTEST21191:~$ docker commit test1 daocloud.io/ubuntu/test1
sha256:b7f27fa969f5eb592625e673c16b2f2dda1e31bcdbeb8d29644e41e61645c03a

root@QKTEST21191:/home/ucsmy# docker run -it –name ubueth -p 8020:8020 ebcd9d4fca80

docker commit ubueth ebcd9d4fca80/ubueth

原创粉丝点击