• docker换源以及拉取镜像


    docker换源

    """
    #1、修改源命令
    vim /etc/docker/daemon.json
    
    
    #2、 添加源
    {
    "registry-mirrors": [
    "https://kfwkfulq.mirror.aliyuncs.com",
    "https://2lqq34jg.mirror.aliyuncs.com",
    "https://pee6w651.mirror.aliyuncs.com",
    "https://registry.docker-cn.com",
    "http://hub-mirror.c.163.com"
    ],
    "dns": ["8.8.8.8","8.8.4.4"]
    }
    
    #3、重启docker服务
    systemctl restart docker
    """
    

    镜像相关

    # 镜像当成是一个没有启动的操作系统
    # redis镜像,mysql镜像,nginx镜像,django镜像,python镜像:linux+xx软件----》镜像跑起来--》容器:操作系统上运行着redis服务
    
    # 查找镜像网址:https://hub.docker.com/
    docker search helloworld
    docker search centos
    NAME     DESCRIPTION                    STARS          OFFICIAL         AUTOMATED
    centos  The official build of CentOS.   5956            [OK]            是否是自动构建
    # 获取镜像:
    
    docker pull centos     # 拉取最新的:相当于docker pull centos:latest  
    docker pull centos:centos7  # 拉取一个centos7
    docker pull centos:centos6.7
    docker pull centos:centos10 # 这个 没有,就报错
      
    # 查看本地镜像
    docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    centos              latest              470671670cac        3 months ago        237MB
    centos              centos7             5e35e350aded        5 months ago        203MB
    
    # 删除本地镜像
    docker rmi 470671670cac  # 通过id号删除
    docker rmi centos:centos7 # 通过名字删除
      
    # 删除所有镜像
    # docker rmi `docker images -q`
    相当于删除后面加一堆id号
    docker rmi  470671670cac 5e35e350aded 
    
  • 相关阅读:
    [题解] [HNOI2014] 世界树
    [luogu 5301][bzoj 5503] [GXOI/GZOI2019] 宝牌一大堆
    [HDU4507]吉哥系列故事——恨7不成妻
    [国家集训队]聪聪可可
    [模板]点分治
    [2018.8.12]模拟赛B组
    JZOJ5804. 【2018.08.12提高A组模拟】简单的序列
    2018.8.10模拟赛
    2018.8.8模拟赛
    [2018.8.6]模拟赛
  • 原文地址:https://www.cnblogs.com/yafeng666/p/12790338.html
Copyright © 2020-2023  润新知