便于镜像的直接拉取
将已经暂停的容器都删除
创建钥匙,在创建仓库后,拥有证书钥匙的用户才能使用镜像仓库
安全证书的仓库建立
删除所有关闭的容器
[root@foundation23 docker]# docker container prune
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y
重命名,生成新的镜像
[root@foundation23 docker]# docker tag nginx localhost:5000/nginx
[root@foundation23 docker]# openssl req -newkey rsa:4095 -nodes -sha256 -keyout certs/domain.key -x509 -days 365 -out certs/domain.crt
Generating a 4095 bit RSA private key
..........++
.......................++
writing new private key to 'certs/domain.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:cn
State or Province Name (full name) []:shaanxi
Locality Name (eg, city) [Default City]:xi'an
Organization Name (eg, company) [Default Company Ltd]:westos
Organizational Unit Name (eg, section) []:linux
Common Name (eg, your name or your server's hostname) []:westos.org
Email Address []:root@westos.org
[root@foundation23 docker]# ls
certs Dockerfile dvd.repo ssh supervisord.conf test web
[root@foundation23 docker]# cd certs/
[root@foundation23 certs]# ls
domain.crt domain.key
创建镜像仓库,必须在/tmp/docker目录中
[root@foundation23 docker]# docker run -d \
>