• 1.docker学习


    Docker —— 从入门到实践

    http://udn.yyuap.com/doc/docker_practice/introduction/index.html

    非常详细的Docker学习教程

    https://blog.csdn.net/zmx729618/article/details/72930474/

    Docker入门实战

    https://yuedu.baidu.com/ebook/d817967416fc700abb68fca1?pn=1&rf=https%3A%2F%2Fyuedu.baidu.com%2Fsearch%3Fword%3Ddocker%26pbook%3D0

    Docker for Mac 安装

    https://docs.docker.com/docker-for-mac/install/

    基本概念:

    Docker 包括三个基本概念

    • 镜像(Image)

    • 容器(Container)

    • 仓库(Repository)

    Docker 镜像就是一个只读的模板。

    例如:一个镜像可以包含一个完整的 ubuntu 操作系统环境,里面仅安装了 Apache 或用户需要的其它应用程序。

    镜像可以用来创建 Docker 容器。

    Docker 提供了一个很简单的机制来创建镜像或者更新现有的镜像,用户甚至可以直接从其他人那里下载一个已经做好的镜像来直接使用。

    Docker 利用容器来运行应用。

    容器是从镜像创建的运行实例。它可以被启动、开始、停止、删除。每个容器都是相互隔离的、保证安全的平台。

    可以把容器看做是一个简易版的 Linux 环境(包括root用户权限、进程空间、用户空间和网络空间等)和运行在其中的应用程序。

    仓库是集中存放镜像文件的场所。有时候会把仓库和仓库注册服务器(Registry)混为一谈,并不严格区分。实际上,仓库注册服务器上往往存放着多个仓库,每个仓库中又包含了多个镜像,每个镜像有不同的标签(tag)。

    仓库分为公开仓库(Public)和私有仓库(Private)两种形式。

    最大的公开仓库是 Docker Hub,存放了数量庞大的镜像供用户下载。 国内的公开仓库包括 Docker Pool等,可以提供大陆用户更稳定快速的访问。

    当然,用户也可以在本地网络内创建一个私有仓库。

    当用户创建了自己的镜像之后就可以使用 push 命令将它上传到公有或者私有仓库,这样下次在另外一台机器上使用这个镜像时候,只需要从仓库上 pull 下来就可以了。

    基本命令:

    查找镜像     sudo docker search ubuntu:14.04

    下载镜像    sudo docker pull ubuntu:14.04

    显示本地镜像   sudo  docker images

    创建容器    sudo docker run --name test -it ubuntu:14.04 /bin/bash    -d命令可用于后台运行容器   -p 用于端口映射  -p 8140 或者 -p 8140:8080两种用法

    修改容器后保存为新的镜像    sudo docker commit -a "zc" -m "my ubuntu" 593672a640ef ubuntu:base

    利用Dockerfile创建镜像    sudo docker build

    从本地系统导入    sudo docker import

    上传镜像    sudo docker push

    存出镜像    sudo docker save -o ubuntu_14.04.tar ubuntu:14.04

    载入镜像  sudo docker load --input ubuntu_14.04.tar
    移除容器  sudo docker rm test

    移除镜像    sudo docker rmi ubuntu:14.04

    开始/停止/杀死容器    sudo docker start/stop/kill

    连接到已有的容器    sudo docker exec -it 5936 /bin/bash

    Commands:

      attach      Attach to a running container

      build       Build an image from a Dockerfile

      commit      Create a new image from a container's changes

      cp          Copy files/folders between a container and the local filesystem

      create      Create a new container

      deploy      Deploy a new stack or update an existing stack

      diff        Inspect changes to files or directories on a container's filesystem

      events      Get real time events from the server

      exec        Run a command in a running container

      export      Export a container's filesystem as a tar archive

      history     Show the history of an image

      images      List images

      import      Import the contents from a tarball to create a filesystem image

      info        Display system-wide information

      inspect     Return low-level information on Docker objects

      kill        Kill one or more running containers

      load        Load an image from a tar archive or STDIN

      login       Log in to a Docker registry

      logout      Log out from a Docker registry

      logs        Fetch the logs of a container

      pause       Pause all processes within one or more containers

      port        List port mappings or a specific mapping for the container

      ps          List containers

      pull        Pull an image or a repository from a registry

      push        Push an image or a repository to a registry

      rename      Rename a container

      restart     Restart one or more containers

      rm          Remove one or more containers

      rmi         Remove one or more images

      run         Run a command in a new container

      save        Save one or more images to a tar archive (streamed to STDOUT by default)

      search      Search the Docker Hub for images

      start       Start one or more stopped containers

      stats       Display a live stream of container(s) resource usage statistics

      stop        Stop one or more running containers

      tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

      top         Display the running processes of a container

      unpause     Unpause all processes within one or more containers

      update      Update configuration of one or more containers

      version     Show the Docker version information

      wait        Block until one or more containers stop, then print their exit codes

  • 相关阅读:
    C++: string的大小写转换
    c++自由的转换string和number
    C# 中的数据库操作~存储过程篇Mysql SqlServer
    Google Protocol Buffer Basics: C++
    C#中的扩展方法(向已有类添加方法,但无需创建新的派生类型)
    多态以及虚析构函数的使用
    【Java基础】String 相关知识点总结
    【设计模式】抽象工厂模式
    【设计模式】工厂方法模式
    【设计模式】简单工厂
  • 原文地址:https://www.cnblogs.com/robinunix/p/9458731.html
Copyright © 2020-2023  润新知