zoukankan      html  css  js  c++  java
  • docker镜像管理基础操作

    docker image pull nginx:1.14-alpine
    docker image pull busybox
    docker pull quay.io/coreos/flannel:v0.10.0-amd64
    docker image pull redis:4-alpine
    docker run --name b1 -it busybox(操作完后别关闭)
    docker commit -p b1 (做镜像)
    docker tag 95249914d032 mageedu/httpd:v0.1-1(给镜像id95249914d032打标,冒号后面是标签)
    docker tag mageedu/httpd:v0.1-1 magedu/httpd:latest (再次做镜像)
    docker image rm magedu/httpd:latest
    docker commit -a '作者信息' -c "CMD ['/bin/httpd'(命令源which可查),'-f'(前台),'-h'(指定目录根),'/data/html'(目录)]" -p(暂停) b1 m/httpd:v1(改镜像启动后前台运行,注意引号)
    docker inspect (查看信息)
    推镜像
    docker login -u 网站用户名 (输入密码后提示Login Succeeded成功)
    docker push XXX/httpd(不加标签默认这个名字都推上去,XXX是网上的名字必须一致不然无法推)

    登录阿里云仓库
    https://cr.console.aliyun.com/repository/cn-shenzhen/le1543/httpd/details
    docker login --username=xxxx@163.com registry.cn-shenzhen.aliyuncs.com
    docker tag [ImageId] registry.cn-shenzhen.aliyuncs.com/le1543/httpd:[镜像版本号]
    docker push registry.cn-shenzhen.aliyuncs.com/le1543/httpd:[镜像版本号]

    过程
    docker login --username=xxxx.com registry.cn-shenzhen.aliyuncs.com(登录阿里云仓库)
    docker tag le1543/httpd:v2 registry.cn-shenzhen.aliyuncs.com/le1543/httpd:v2 (做镜像)
    docker push registry.cn-shenzhen.aliyuncs.com/le1543/httpd (可带版本)

    打包镜像
    docker save -o 打包名称 被打包文件1 被打包文件2 被打包文件3.......
    传送到其他主机
    scp myimages2.gz 192.168.3.22:/root/


    其他主机上解压

    docker load -i myimages2.gz
    docker images就能看到新入的两个备份镜像

    docker run --name 容器名 目标名称:版本 (已经封装前台测试)
    docker run --name t1 registry.cn-shenzhen.aliyuncs.com/le1543/httpd:v2
    查看t1容器ip
    docker inspect t1
    curl ip

  • 相关阅读:
    开源项目之Android StandOut(浮动窗口)
    小智慧7
    安卓学习
    asp.net学习Request和Response的其他属性
    bash中的转义
    POJ 1833 排列
    Django点滴(四)ORM对象存取
    POJ 1681 Painter's Problem
    linux2.6.32在mini2440开发板上移植(21)之WebServer服务器移植
    [gkk传智]static与多态及向下向上转型,及多态调用总结
  • 原文地址:https://www.cnblogs.com/Leaders543/p/12102157.html
Copyright © 2011-2022 走看看