zoukankan      html  css  js  c++  java
  • Docker虚拟机

    • Docker安装环境要求

      ubuntu安装:https://www.cnblogs.com/senlinyang/p/8203191.html

      在安装Docker前需要确保操作系统内核版本为 3.10以上,因此需要CentOS7 ,CentOS7内核版本为3.10

    • 卸载Docker
    yum remove docker 
        docker-common 
        docker-selinux 
        docker-engine
    • 安装Docker环境依赖
    yum install -y yum-utils device-mapper-persistent-data lvm2
    • 配置Docker的yum源
    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    • 查看Docker可安装版本
    yum list docker-ce --showduplicates | sort -r
    • 安装Docker
    yum install docker-ce
    • 启动Docker
    systemctl start docker
    • 保存镜像为文件
    docker save docker.io/java > /root/java.tar.gz
    • 转换文件为镜像
    docker load < /root/java.tar.gz

    • 暂停容器
    docker pause java_run
    • 取消暂停
    docker unpause java_run

    • docker镜像修改名字
    docker tag percona/percona-xtradb-cluster pxc

    • docker创建内部网段
    docker network create --subnet=172.18.0.0/24 net1
    • docker查看创建的内部网段的信息
    docker network inspect net1
    • docker移除创建的内部网段
    docker nerwork rm net1
    docker login --username=username registry.cn-hangzhou.aliyuncs.com
    • 推送镜像到阿里云镜像仓库
    docker tag nginx registry.cn-hangzhou.aliyuncs.com/pascall/nginx
    docker push registry.cn-hangzhou.aliyuncs.com/pascall/nginx
    •  Docker Compose安装
    yum -y install epel-release python-pip
    pip install docker-compose
    •  Docker login 出错
    Error response from daemon: Get https://XX/v2/: dial tcp XX:443: connect: connection refused
    find / -name docker.service -type f    # 查找docker.service所在的位置
    vim /etc/systemd/system/docker.service    # 添加--insecure-registry=XX
    
    
    [Service]
    
    Environment="PATH=/opt/kube/bin:/bin:/sbin:/usr/bin:/usr/sbin"
    
    ExecStart=/opt/kube/bin/dockerd --insecure-registry=XX
    
    ExecStartPost=/sbin/iptables -I FORWARD -s 0.0.0.0/0 -j ACCEPT
    
    ExecReload=/bin/kill -s HUP $MAINPID
    
    Restart=on-failure
    
    RestartSec=5
    
    LimitNOFILE=infinity
    
    LimitNPROC=infinity
    
    LimitCORE=infinity
    
    Delegate=yes
    
    KillMode=process
    
    systemctl daemon-reload  # 加载配置
    systemctl restart docker  # 重启docker
  • 相关阅读:
    Oracle中修改表名遇到“ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效”
    zabbix监控华为服务器硬件状态
    基于LLDP和OpenFlow的网络拓扑检测
    应用nslookup命令查看A记录、MX记录、CNAME记录和NS记录
    Dockerfile
    Get Docker CE for CentOS
    前端构建工具gulpjs的使用介绍及技巧
    Error: Cannot find module 'gulp-clone'问题的解决
    oracle 12C wmsys.wm_concat()函数
    Windows实现内网IPMI端口转发
  • 原文地址:https://www.cnblogs.com/pascall/p/9749743.html
Copyright © 2011-2022 走看看