标签:size vim images and amp tag ext tar private
分为公共仓库与私有仓库两种。
example:
kumata-docker.com/test-image
// kumata-docker.com -> registry
// test-image -> regisitory
Docker official address: https://hub.docker.com/
// login, it will create ~/.docker/config.json
docker login
// 基操
// 基础镜像/根镜像,一般为单个单词的名字
docker pull centos
// 用户创建并维护,一般为 用户名/镜像名
docker pull hyperledger/explorer
// use registry create private regisitory
docker run -d -p 5000:5000 registry:2
// -v 指定位置
docker run -d -p 5000:5000 -v /opt/data/registry:/var/lib/registr registry:2
// watch
docker images
REPOSITORY | TAG | IMAGE ID | CREATED | SIZE |
---|---|---|---|---|
ubuntu | latest | f643c72bc252 | 12 days ago | 72.9MB |
// add tag to image
docker tag ubuntu:latest 10.8.9.40:5000/ubuntu_test
REPOSITORY | TAG | IMAGE ID | CREATED | SIZE |
---|---|---|---|---|
10.8.9.40:5000/ubuntu_test | latest | f643c72bc252 | 12 days ago | 72.9MB |
Add http config
sudo vim /etc/docker/daemon.json
// add
{"insecure-registries":["10.8.9.40:5000"]}
// restart docker
sudo systemctl daemon-reload
sudo systemctl restart docker
push and pull
// push to registory
docker push 10.8.9.40:5000/ubuntu_test
// pull image
docker pull 10.8.9.40:5000/ubuntu_test
// if need, add tag:
docker tag 10.8.9.40:5000/ubuntu_test ubuntu_kumata:18.04
标签:size vim images and amp tag ext tar private
原文地址:https://www.cnblogs.com/kumata/p/14104057.html