1. 程式人生 > 其它 >IntelliJ IDEA2021啟用碼,我這個可能是最管用的啟用IDEA的途徑了

IntelliJ IDEA2021啟用碼,我這個可能是最管用的啟用IDEA的途徑了

[root@localhost ~]# docker pull registry
[root@localhost ~]# cat /opt/registry/config.yml #registry容器中/etc/docker/registry/目錄下有該檔案,增加刪除私有倉庫映象功能

version: 0.1
log:
 fields:
 service: registry
storage:
 delete:
  enabled: true
 cache:
  blobdescriptor: inmemory
 filesystem:
  rootdirectory: /var/lib/registry
http:
 addr: :
5000 headers: X-Content-Type-Options: [nosniff] health: storagedriver: enabled: true interval: 10s threshold: 3

[root@localhost ~]# docker run -d -p 5000:5000 --privileged=true -v /opt/registry:/var/lib/registry -v /opt/registry/config.yml:/etc/docker/registry/config.yml --name registry registry
# -v /opt/registry表示的宿主機中的registry目錄,沒有該目錄會自動建立,/var/lib/registry表示容器內部的registry目錄
[root@localhost ~]# docker exec -it [CONTAINER ID] sh #進入registry容器
[root@localhost ~]# docker tag centos:610 10.10.80.10:5000/centos610
[root@localhost ~]# docker push 10.10.80.10:5000/centos610
The push refers to repository [10.10.80.10/centos610]
Get https://10.10.80.10/v2/: dial tcp 10.10.80.10:443: getsockopt: connection refused
[root@localhost ~]# vim /usr/lib/systemd/system/docker.service

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd --insecure-registry 10.10.80.10:5000

[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker.service
查詢上傳映象的sha256的值(api方式)
[root@localhost ~]# curl --header "Accept: application/vnd.docker.distribution.manifest.v2+json" -I -X HEAD http://10.10.80.10:5000/v2/centos610/manifests/latest
查詢上傳映象的sha256的值(進入映象檔案目錄)
[root@localhost ~]# ll /opt/registry/docker/registry/v2/repositories/centos610/_manifests/revisions/sha256

total 0
drwxr-xr-x 2 root root 6 Jul  9 15:03 4c1f1ca8236a47428999a4e0730a714a07c6a4594b61c73e8f24c493fe8b3625

刪除私有倉庫映象
[root@localhost ~]# curl -v -X DELETE http://10.10.80.10:5000/v2/centos610/manifests/sha256:4c1f1ca8236a47428999a4e0730a714a07c6a4594b61c73e8f24c493fe8b3625
登陸registry容器執行registry命令(垃圾回收)
[root@localhost ~]# docker exec -it 811f7a36ffd1 sh
/ # registry garbage-collect /etc/docker/registry/config.yml


參考連結:
https://www.cnblogs.com/Tempted/p/7768694.html
https://www.cnblogs.com/huanchupkblog/p/10843800.html
https://www.cnblogs.com/maohai-kdg/p/13677650.html
https://blog.csdn.net/weixin_43467082/article/details/86062949
https://www.cnblogs.com/lkun/p/7990466.html
https://www.linuxidc.com/Linux/2020-04/163009.htm
https://www.jianshu.com/p/b93feaf43f37
http://www.louisvv.com/archives/1130.html
https://www.cnblogs.com/andy9468/p/10737228.html #Docker私有倉庫搭建(加密和使用者驗證)