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

转载于:https://www.cnblogs.com/robinunix/p/9458731.html

1.docker学习相关推荐

  1. Docker:学习笔记(1)——基础概念

    Docker:学习笔记(1)--基础概念 Docker是什么 软件开发后,我们需要在测试电脑.客户电脑.服务器安装运行,用户计算机的环境各不相同,所以需要进行各自的环境配置,耗时耗力.为了解决这个问题 ...

  2. [转]Docker学习之四:使用docker安装mysql

    本文转自:https://blog.csdn.net/qq_19348391/article/details/82998391 Docker学习之一:注册Docker Hub账号 Docker学习之二 ...

  3. Docker学习之路 用commit命令创建镜像

    Docker学习之路 用commit命令创建镜像 docker 74k 次阅读 · 读完需要 7 分钟 假期快要结束了,干点正事,接着Docker的学习. 构建镜像 构建镜像的两种方法: 使用dock ...

  4. Docker 学习资源整理

    Docker 是近年来非常火的容器技术,而且啊 Docke r不仅仅是红帽和Canonical等Linux巨头眼里的宠儿,微软等专有软件公司也在热烈拥抱 Docker,所以就知道 Docker 为啥这 ...

  5. Docker学习与和应用(二)_使用Docker

    在前一篇文章 Docker学习与和应用(一)_初步认识中,我们初步介绍了Docker解决了什么问题,Docker容器化技术与传统的虚拟化方式的区别,以及简要介绍了Docker的几大核心概念:镜像.容器 ...

  6. Docker学习笔记_网上资源参考

    Docker学习,网上资源参考 1.菜鸟教程:                                                        http://www.runoob.com ...

  7. Docker学习七:使用docker搭建Hadoop集群

    本博客简单分享了如何在Docker上搭建Hadoop集群,我的电脑是Ubuntu20,听同学说wsl2有些命令不对,所以建议在虚拟机里按照Ubuntu或者直接安装双系统吧 Docker学习一:Dock ...

  8. Docker学习六:综合实践

    前言 本次学习来自于datawhale组队学习: 教程地址为: https://github.com/datawhalechina/team-learning-program/tree/master/ ...

  9. Docker学习五:Docker 数据管理

    前言 本次学习来自于datawhale组队学习: 教程地址为: https://github.com/datawhalechina/team-learning-program/tree/master/ ...

  10. Docker学习四:Docker 网络

    前言 本次学习来自于datawhale组队学习: 教程地址为: https://github.com/datawhalechina/team-learning-program/tree/master/ ...

最新文章

  1. Python 类—类属性(私有属性、公有属性、实例属性、局部变量)类方法(实例方法、静态方法)
  2. 央视首位AI手语主播亮相,动作精确、实时转译,网友:能接住广权的段子么?...
  3. 转载:谢谢原作者:块设备驱动实战基础篇三 (BIO请求回调机制)
  4. 利用js实现table增加一行
  5. Linux物理内存初始化
  6. 通过脚本设置Windows系统ip地址
  7. MogDB与PostgreSQL分区策略语法测试
  8. excel文件占用空间大 xls xlsx等文件
  9. OpenCV-模板匹配cv::matchTemplate
  10. 【动态规划】路径dp:蓝桥2020: 数字三角形
  11. java开发工程师报名费多少_JAVA软件工程师资格证书 怎么考
  12. 《Python股票量化交易从入门到实践》学习记录
  13. 好听的摇滚_好听的摇滚歌曲大全
  14. 情商 智商 逆商,哪个最重要?
  15. uint64_t {aka long unsigned int}
  16. 内存(DDR/DDR2/DDR3/DDR4)的速度等级和时钟频率———个人笔记
  17. 指南-Luat二次开发教程指南-功能开发教程-socket
  18. 酷客scrm发布:陌生人扫码进群原来是这么回事
  19. 【笔记】nginx - 上:安装、配置(基础、rewrite 重写、proxy_pass 代理、ssl)
  20. PostMan接口参数化、接口返回值传递

热门文章

  1. 转换文档参数_Word、Excel、PDF多格式转换?只需1招全搞定
  2. 员工管理的html页面,员工管理.html
  3. 乒乓球训练机_比教练更牛的全新乒乓球机器人,超拟人黑科技,引领未来体育浪潮...
  4. discuz 后台页面扩展开发
  5. 利用HTML+JS+CSS实现简单的网页计算器,附html所有源代码,可直接黏贴运行
  6. 计算机运算器存储器知识点,计算机一级知识点:运算器、控制器
  7. Windows Mobile 5.0新增API介绍(转自MSDN)
  8. LeetCode简单题目(#235 #237 #242 #257 #258)-5道(树、数字、字符串)
  9. linux启动找不到内核,linux – PXE启动 – 在TFTP服务器上找不到内核
  10. FPGA开源IP核下载opencores.org