## 二、上传镜像到本地私有库registry
### 1、下载镜像docker registry
docker pull registry
### 2、运行私有库registry,相当于本地有个私有docker hub。
docker run -d -p 5000:5000 -v /yoyo/myregistry/:/tmp/registry --privileged=true registry
### 3、制作一个带有ifconfig的Ubuntu镜像
#docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest ba6acccedd29 2 years ago 72.8MB
#docker run -it ba6acccedd29
root@32e09b37ba40:/# apt-get update
root@32e09b37ba40:/# apt-get install net-tools -y
root@32e09b37ba40:/# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.3 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:acff:fe11:3 prefixlen 64 scopeid 0x20
ether 02:42:ac:11:00:03 txqueuelen 0 (Ethernet)
RX packets 8745 bytes 31390066 (31.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4426 bytes 243881 (243.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
再使用快捷键 Ctrl+p+q退出,容器继续在后台运行。
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
32e09b37ba40 ba6acccedd29 “bash” 7 minutes ago Up 7 minutes
docker commit -m=“ifconfig cmd add” -a=“yoyo” 32e09b37ba40 ifubuntu:3.24
sha256:f53ed00a420725a04c8ba4314c8