博客地址:http://home.cnblogs.com/u/zengjianrong/

docker harbor托管

harbor使用指南

添加非安全信任:

zjr@zjr-Precision-3630-Tower:~/disk/prjs/IDC_BST_toolchain$ cat /etc/docker/daemon.json
{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    },
    "insecure-registries":[
        "10.249.2.44"
    ],
    "registry-mirrors":["https://docker.mirrors.ustc.edu.cn/"]
}

重启docker服务:sudo docker service restart

  1. 登陆: sudo docker login 10.249.2.44
  2. 拉取idc镜像:sudo docker pull 10.249.2.44/idc/idc_docker:[tag]
  3. docker后台运行,NAMES设置为idc: sudo docker run -tid --name="idc" 10.249.2.44/idc/idc_docker:[tag]
    1. NAMES的设置是为了标识此container,等价于container_id
  4. 连接docker
    1. 【可启动多个】exit不影响docker: sudo docker exec -ti CONTAINER_ID/NAMES /bin/bash
    2. exit后会stop docker: sudo docker attach CONTAINER_ID/NAMES
  5. 修改完数据后exit退出docker,最好是所有docker窗口都需要退出,或者直接停止此container:sudo docker stop CONTAINER_ID/NAMES;
  6. 提交docker:sudo docker commit -a "author" -m "comments" CONTAINER_ID/NAMES  10.249.2.44/idc/idc_docker:[new_tag]
  7. 【通常不需要此操作】替换tag:sudo docker tag 10.249.2.44/idc/idc_docker:[tag] 10.249.2.44/idc/idc_docker:[new_tag]
  8. 提交idc镜像:sudo docker push 10.249.2.44/idc/idc_docker:[new_tag]

 

posted @ 2022-03-17 10:35  black_man  阅读(52)  评论(0编辑  收藏  举报