• Docker: 仓库管理


    docker respository

    分为公共仓库与私有仓库两种。

    • 注册服务器 registry: 存放仓库的具体服务器,可容纳多个仓库
    • 仓库 regisitory: 存放镜像的一个具体的项目目录,可容纳多个镜像

    example:

    kumata-docker.com/test-image
    // kumata-docker.com -> registry
    // test-image -> regisitory
    

    1. 公共镜像市场

    Docker official address: https://hub.docker.com/

    // login, it will create ~/.docker/config.json
    docker login
    
    // 基操
    // 基础镜像/根镜像,一般为单个单词的名字
    docker pull centos
    // 用户创建并维护,一般为 用户名/镜像名
    docker pull hyperledger/explorer
    
    

    2. 搭建本地私有仓库

    1. 自动下载并启动一个registry contain,默认创建在 /var/lib/registry 下:
    // 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
    
    1. 管理私有仓库
    // 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
    
  • 相关阅读:
    Oracle11gR2下PL/SQL访问网络的错误ORA24247
    安装cx_Oracle
    搭建基于FreeNAS的共享存储
    unique constraint 和 unique index 的关系
    Oracle11gR2_RAC全静默安装攻略
    struts中的constant详解 (转载)
    网摘
    用 Google 的 FaceNet 做人脸识别极客帮课程笔记
    【Linux】Git 安装最新版
    【Jmeter】性能测试EMQ X 压测
  • 原文地址:https://www.cnblogs.com/kumata/p/14104057.html
Copyright © 2020-2023  润新知