欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
Docker
小 (→文档) |
小 (→指南) |
||
(未显示1个用户的38个中间版本) | |||
第7行: | 第7行: | ||
[[OpenStack]]也在其最新发行版(代号Havana)中引入了Docker。 | [[OpenStack]]也在其最新发行版(代号Havana)中引入了Docker。 | ||
[[文件:Docker-logo.png|right]] | [[文件:Docker-logo.png|right]] | ||
+ | ==原理== | ||
+ | Docker 是封装自 [[LXC]] 和 [[cgroup]] 的虚拟化技术。 | ||
+ | |||
+ | Docker的overlay存储驱动建立在OverlayFS文件系统之上,它允许将一个文件系统与另一个文件系统重叠(overlay),在上层的文件系统中记录更改,而下层的文件系统保持不变,OverlayFS从Linux 3.18版本以后已进入内核主线。 | ||
+ | |||
==指南== | ==指南== | ||
+ | 下载Docker,如[https://docs.docker.com/docker-for-mac/install/ macOS] 或 | ||
+ | |||
Docker Toolbox包含: | Docker Toolbox包含: | ||
* Docker Client | * Docker Client | ||
第20行: | 第27行: | ||
$ docker-compose version | $ docker-compose version | ||
$ docker run debian /bin/echo hello world | $ docker run debian /bin/echo hello world | ||
+ | |||
+ | 一些配置参考:cat /etc/docker/daemon.json | ||
+ | { | ||
+ | "registry-mirrors": ["https://registry.docker-cn.com"], | ||
+ | "insecure-registries": ["172.30.2.245:5000"], | ||
+ | "exec-opts": ["native.cgroupdriver=systemd"] | ||
+ | } | ||
+ | 进入一个正在运行容器,如: | ||
+ | docker exec -t -i <id/container_name> /bin/bash | ||
+ | |||
+ | 清理所有Docker容器、容器卷和镜像 [https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes How To Remove Docker Images, Containers, and Volumes] | ||
+ | docker rm -f $(docker ps -qa) | ||
+ | docker volume rm $(docker volume ls -q) | ||
+ | docker rmi -f $(docker images -q) | ||
+ | 清除所有未使用或悬挂(Unused or Dangling)的镜像、容器、卷和网络 | ||
+ | docker container prune | ||
+ | docker system prune | ||
+ | |||
+ | ==[[Debian]]== | ||
+ | [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-debian-10 How To Install and Use Docker on Debian 10] | ||
+ | $ sudo apt update | ||
+ | $ sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common | ||
+ | $ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - | ||
+ | $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | ||
+ | $ sudo apt update | ||
+ | $ apt-cache policy docker-ce | ||
+ | $ sudo apt install docker-ce | ||
+ | $ sudo systemctl status docker | ||
+ | |||
+ | |||
+ | ==CentOS== | ||
+ | [[CentOS]] 8 install Docker | ||
+ | curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo | ||
+ | or yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo | ||
+ | yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm | ||
+ | yum install docker-ce | ||
+ | systemctl start docker | ||
==Python== | ==Python== | ||
第28行: | 第72行: | ||
*[https://github.com/docker/docker-status docker-status] | *[https://github.com/docker/docker-status docker-status] | ||
*[https://github.com/docker/docker-registry docker-registry] 创建自己的私有注册库 | *[https://github.com/docker/docker-registry docker-registry] 创建自己的私有注册库 | ||
+ | |||
+ | ==项目== | ||
+ | *[https://github.com/shipyard/shipyard Shipyard] | ||
+ | *[https://github.com/squidnyan/docker-registry-ui Docker Registry UI] | ||
+ | *[https://github.com/kevana/ui-for-docker UI For Docker] | ||
+ | *[[docker/seagull|Seagull]] | ||
+ | *[https://github.com/openstack/kolla Kolla] - Deploying [[OpenStack]] using Docker | ||
==部署== | ==部署== | ||
第34行: | 第85行: | ||
* 通过[[Apache Mesos]]管理Docker,Twitter、Paypal、数人云、灵雀云采用。 | * 通过[[Apache Mesos]]管理Docker,Twitter、Paypal、数人云、灵雀云采用。 | ||
* 通过[[kubernetes]]管理Docker,UCloud采用。 | * 通过[[kubernetes]]管理Docker,UCloud采用。 | ||
+ | * 通过[https://github.com/docker/swarm/ Docker Swarm]部署Docker集群。 | ||
[http://docs.huihoo.com/infoq/qconshanghai/2015/%E5%AE%B9%E5%99%A8%E4%B8%8E%E4%BA%91%E8%AE%A1%E7%AE%97/ >>>更多细节] | [http://docs.huihoo.com/infoq/qconshanghai/2015/%E5%AE%B9%E5%99%A8%E4%B8%8E%E4%BA%91%E8%AE%A1%E7%AE%97/ >>>更多细节] | ||
*[http://docs.huihoo.com/docker/OpenStack-Heat+Docker.pdf Docker plugin for Heat] | *[http://docs.huihoo.com/docker/OpenStack-Heat+Docker.pdf Docker plugin for Heat] | ||
+ | *[https://github.com/ContainerSolutions/ImageWolf ImageWolf] - Fast Distribution of Docker Images on Clusters | ||
==文档== | ==文档== | ||
+ | *[http://docs.huihoo.com/javaone/2015/CON7506-Java-EE-Application-Servers-Multitenant-or-Containerized-Both.pdf Java EE Application Servers: Multitenant or Containerized? Both!] | ||
+ | *[http://docs.huihoo.com/javaone/2015/CON6832-Debugging-Java-Apps-in-Containers-No-Heavy-Welding-Gear-Required.pdf Debugging Java Apps in Containers: No Heavy Welding Gear Required] | ||
+ | *[http://docs.huihoo.com/javaone/2015/BOF7537-Running-Oracle-WebLogic-Server-on-Docker-Challenges-and-Workarounds.pdf Running Oracle WebLogic Server on Docker: Challenges and Workarounds] | ||
+ | *[http://docs.huihoo.com/go/gopherchina/2015/1-8%20Go%20%e5%9c%a8%e6%8c%81%e7%bb%ad%e4%ba%a4%e4%bb%98%e4%b8%ad%e7%9a%84%e5%ae%9e%e8%b7%b5.pdf Golang, Microservices, Continuous Delivery and Docker] | ||
+ | *[http://docs.huihoo.com/go/gopherchina/2015/2-8%20docker%e5%8e%9f%e7%90%86%e4%b8%8e%e5%ba%94%e7%94%a8%e5%ae%9e%e8%b7%b5.pdf Docker 原理与应用实践] | ||
*[http://docs.huihoo.com/infoq/archsummit/bj2015/1219/%e5%9f%ba%e7%a1%80%e6%9e%b6%e6%9e%84%e4%b9%8b%e6%8a%80%e6%9c%af%e6%bc%94%e8%bf%9b%ef%bc%88%e5%8e%82%e5%95%86%e5%85%b1%e5%bb%ba%e4%b8%93%e9%a2%98%ef%bc%89/ArchSummit%e5%8c%97%e4%ba%ac-%e3%80%8aDocker%e6%9e%b6%e6%9e%84%e4%b8%8b%e7%a7%81%e6%9c%89%e4%ba%91%e7%9a%84%e6%9c%ba%e9%81%87%e4%b8%8e%e6%8c%91%e6%88%98%e3%80%8b-%e7%8e%8b%e6%8c%af%e5%a8%81.pdf Docker架构私有云的机遇和挑战] | *[http://docs.huihoo.com/infoq/archsummit/bj2015/1219/%e5%9f%ba%e7%a1%80%e6%9e%b6%e6%9e%84%e4%b9%8b%e6%8a%80%e6%9c%af%e6%bc%94%e8%bf%9b%ef%bc%88%e5%8e%82%e5%95%86%e5%85%b1%e5%bb%ba%e4%b8%93%e9%a2%98%ef%bc%89/ArchSummit%e5%8c%97%e4%ba%ac-%e3%80%8aDocker%e6%9e%b6%e6%9e%84%e4%b8%8b%e7%a7%81%e6%9c%89%e4%ba%91%e7%9a%84%e6%9c%ba%e9%81%87%e4%b8%8e%e6%8c%91%e6%88%98%e3%80%8b-%e7%8e%8b%e6%8c%af%e5%a8%81.pdf Docker架构私有云的机遇和挑战] | ||
*[http://docs.huihoo.com/infoq/archsummit/bj2015/1219/UCloud%e6%8a%80%e6%9c%af%e4%b8%93%e5%9c%ba%ef%bc%9a%e4%bc%81%e4%b8%9a%e5%ae%b9%e5%99%a8%e5%8c%96%e5%ba%94%e7%94%a8%e5%ae%9e%e8%b7%b5%ef%bc%88%e5%8e%82%e5%95%86%e5%85%b1%e5%bb%ba%e4%b8%93%e9%a2%98%ef%bc%89/ArchSummit%e5%8c%97%e4%ba%ac-%e3%80%8a%e7%bb%8f%e9%aa%8c%e5%88%86%e4%ba%ab%ef%bc%9a%e5%a4%a7%e4%bc%97%e7%82%b9%e8%af%84%e7%a7%81%e6%9c%89%e4%ba%91%e5%b9%b3%e5%8f%b0%e4%b9%8bDocker%e5%ae%9e%e8%b7%b5%e3%80%8b-%e7%9b%9b%e5%bb%b6%e6%95%8f.pdf 经验分享:大众点评私有云平台之Docker实践] | *[http://docs.huihoo.com/infoq/archsummit/bj2015/1219/UCloud%e6%8a%80%e6%9c%af%e4%b8%93%e5%9c%ba%ef%bc%9a%e4%bc%81%e4%b8%9a%e5%ae%b9%e5%99%a8%e5%8c%96%e5%ba%94%e7%94%a8%e5%ae%9e%e8%b7%b5%ef%bc%88%e5%8e%82%e5%95%86%e5%85%b1%e5%bb%ba%e4%b8%93%e9%a2%98%ef%bc%89/ArchSummit%e5%8c%97%e4%ba%ac-%e3%80%8a%e7%bb%8f%e9%aa%8c%e5%88%86%e4%ba%ab%ef%bc%9a%e5%a4%a7%e4%bc%97%e7%82%b9%e8%af%84%e7%a7%81%e6%9c%89%e4%ba%91%e5%b9%b3%e5%8f%b0%e4%b9%8bDocker%e5%ae%9e%e8%b7%b5%e3%80%8b-%e7%9b%9b%e5%bb%b6%e6%95%8f.pdf 经验分享:大众点评私有云平台之Docker实践] | ||
第80行: | 第138行: | ||
<gallery> | <gallery> | ||
image:Container-ecosystem.png|容器生态系统 | image:Container-ecosystem.png|容器生态系统 | ||
+ | image:Docker-Container-App-Lifecycle.png|Docker应用生命周期 | ||
image:docker-architecture.jpg|架构 | image:docker-architecture.jpg|架构 | ||
image:what-is-docker.png|Docker是什么 | image:what-is-docker.png|Docker是什么 | ||
第85行: | 第144行: | ||
image:virtual-machine-and-container.png|虚拟机和容器 | image:virtual-machine-and-container.png|虚拟机和容器 | ||
image:docker-and-openstack.png|OpenStack | image:docker-and-openstack.png|OpenStack | ||
+ | image:openstack-docker-hadoop.png|与OpenStack/Hadoop的融合 | ||
image:docker-and-lxc.png|Docker和LXC的关系 | image:docker-and-lxc.png|Docker和LXC的关系 | ||
image:docker-at-redhat.png|红帽的方向 | image:docker-at-redhat.png|红帽的方向 | ||
第91行: | 第151行: | ||
image:docker-integrated-jenkins.png|集成Jenkins | image:docker-integrated-jenkins.png|集成Jenkins | ||
image:iaas-vs-paas.png|IaaS和PaaS | image:iaas-vs-paas.png|IaaS和PaaS | ||
+ | image:openshift-all-in-one.png|OpenShift | ||
+ | image:Red-Hat-Container-Stack.png|红帽容器堆栈 | ||
+ | image:OpenShift-Kubernetes-Docker-HDP.png|容器PaaS与大数据 | ||
+ | image:aliyun-docker-repo.png|阿里Docker镜像加速器 | ||
+ | image:harbor-cephfs.png|Harbor私有容器仓库 | ||
+ | image:data-containers.jpg|数据容器 | ||
</gallery> | </gallery> | ||
第96行: | 第162行: | ||
*[https://www.docker.io/ Docker官网] | *[https://www.docker.io/ Docker官网] | ||
*[https://github.com/dotcloud/docker Docker @ GitHub] | *[https://github.com/dotcloud/docker Docker @ GitHub] | ||
− | *[https:// | + | *[https://htmlpreview.github.io/?https://github.com/redhat-developer/docker-java/blob/javaone2015/readme.html Docker for Java Developers] |
+ | *[https://github.com/veggiemonk/awesome-docker Awesome Docker] [[image:awesome.png]] | ||
+ | *[https://github.com/Friz-zy/awesome-linux-containers Awesome Linux Containers] [[image:awesome.png]] | ||
+ | *[http://dockone.io/ DockOne.io] | ||
*[https://wiki.openstack.org/wiki/Docker Docker for OpenStack] | *[https://wiki.openstack.org/wiki/Docker Docker for OpenStack] | ||
*[https://github.com/dotcloud/docker/tree/master/hack/infrastructure Docker project infrastructure] | *[https://github.com/dotcloud/docker/tree/master/hack/infrastructure Docker project infrastructure] | ||
第117行: | 第186行: | ||
*[http://segmentfault.com/a/1190000002989928 如何使用 Docker 组件开发 Django 项目?] | *[http://segmentfault.com/a/1190000002989928 如何使用 Docker 组件开发 Django 项目?] | ||
*[https://github.com/jcloudpub/speedy Speedy:来自京东的Docker镜像存储系统] | *[https://github.com/jcloudpub/speedy Speedy:来自京东的Docker镜像存储系统] | ||
+ | *[https://blog.openshift.com/openshift-v3-deep-dive-docker-kubernetes/ OpenShift V3 Deep Dive Tutorial | The Next Generation of PaaS] | ||
+ | *[http://www.youruncloud.com/blog/105.html 当微服务遇见容器] [http://www.youruncloud.com/blog/100.html Docker定义存储-让应用无痛运行] | ||
+ | [[category:virtualization]] | ||
+ | [[category:container]] | ||
[[category:cloud computing]] | [[category:cloud computing]] | ||
+ | [[category:microservices]] | ||
[[category:linux]] | [[category:linux]] | ||
[[category:OpenStack]] | [[category:OpenStack]] | ||
[[category:go]] | [[category:go]] | ||
− |
2022年1月14日 (五) 05:06的最后版本
Docker: the Linux container engine
Docker是一款基于轻量级虚拟化技术的容器引擎,使用 Go 语言开发,采用 Apache V2 许可协议。
Docker可以在容器内部快速自动化部署应用,并可以通过内核虚拟化技术(namespaces及cgroups等)来提供容器的资源隔离与安全保障等。由于Docker通过操作系统层的虚拟化实现隔离,所以Docker容器在运行时,不需要类似虚拟机(VM)额外的操作系统开销,提高资源利用率,并且提升诸如IO等方面的性能。
OpenStack也在其最新发行版(代号Havana)中引入了Docker。
目录 |
[编辑] 原理
Docker 是封装自 LXC 和 cgroup 的虚拟化技术。
Docker的overlay存储驱动建立在OverlayFS文件系统之上,它允许将一个文件系统与另一个文件系统重叠(overlay),在上层的文件系统中记录更改,而下层的文件系统保持不变,OverlayFS从Linux 3.18版本以后已进入内核主线。
[编辑] 指南
下载Docker,如macOS 或
Docker Toolbox包含:
- Docker Client
- Docker Machine
- Docker Compose
- Docker Kitematic
- VirtualBox
下载安装Docker Toolbox
$ docker version $ docker-machine version $ docker-compose version $ docker run debian /bin/echo hello world
一些配置参考:cat /etc/docker/daemon.json
{ "registry-mirrors": ["https://registry.docker-cn.com"], "insecure-registries": ["172.30.2.245:5000"], "exec-opts": ["native.cgroupdriver=systemd"] }
进入一个正在运行容器,如:
docker exec -t -i <id/container_name> /bin/bash
清理所有Docker容器、容器卷和镜像 How To Remove Docker Images, Containers, and Volumes
docker rm -f $(docker ps -qa) docker volume rm $(docker volume ls -q) docker rmi -f $(docker images -q)
清除所有未使用或悬挂(Unused or Dangling)的镜像、容器、卷和网络
docker container prune docker system prune
[编辑] Debian
How To Install and Use Docker on Debian 10
$ sudo apt update $ sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common $ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" $ sudo apt update $ apt-cache policy docker-ce $ sudo apt install docker-ce $ sudo systemctl status docker
[编辑] CentOS
CentOS 8 install Docker
curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo or yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm yum install docker-ce systemctl start docker
[编辑] Python
- com/docker/docker-py docker-py
- Compose
- openstack-docker
- openstack-heat-docker
- docker-status
- docker-registry 创建自己的私有注册库
[编辑] 项目
- Shipyard
- Docker Registry UI
- UI For Docker
- Seagull
- Kolla - Deploying OpenStack using Docker
[编辑] 部署
Docker的多种部署方式:
- 通过OpenStack管理Docker,采用Nova Docker Driver方案来集成,京东采用。
- 通过Apache Mesos管理Docker,Twitter、Paypal、数人云、灵雀云采用。
- 通过kubernetes管理Docker,UCloud采用。
- 通过Docker Swarm部署Docker集群。
- Docker plugin for Heat
- ImageWolf - Fast Distribution of Docker Images on Clusters
[编辑] 文档
- Java EE Application Servers: Multitenant or Containerized? Both!
- Debugging Java Apps in Containers: No Heavy Welding Gear Required
- Running Oracle WebLogic Server on Docker: Challenges and Workarounds
- Golang, Microservices, Continuous Delivery and Docker
- Docker 原理与应用实践
- Docker架构私有云的机遇和挑战
- 经验分享:大众点评私有云平台之Docker实践
- Coding容器化实践分享:Docker理念解析与技术填坑
- Docker与UCloud DataBase的融合实践
- Docker Recipes for Java Developers
- Jenkins for continuous delivery of infrastructure via Docker
- Using the Same Docker Container for Development and in the Cloud
- Google 容器引擎 Run Docker containers on Google Cloud Platform, powered by Kubernetes,每周启动超过20亿个容器
- 基于Docker容器的云计算平台搭建实战
- Docker在百度BAE的实战分享、英文版本
- Docker at Spotify
[编辑] 图书
[编辑] 用户
- 百度应用在自己的PaaS平台:Baidu App Engine (BAE)
- 大规模Docker集群助力微博迎接春晚峰值挑战
- 新浪SCE Docker最佳实践: SAE于2015年11月推出了基于Kuberntetes/Docker的容器云
- 腾讯云刘永峰:容器技术将构建全新游戏自治系统
- 腾讯Docker on Gaia,支撑公司实时计算、游戏云、广点通等不同业务的Docker作业。
- 大众点评在2014年7月就基于Docker搭建了私有云平台,目前平台承担了大部分的线上的业务,实例数2800个左右,Docker物理集群300多台。
- 华为CCE容器云: 2015年7月发布公有云战略,12月推出基于Kubernetes和Docker技术打造的CCE容器云。
- 网易
- 蘑菇街基于Docker的私有云
- 京东在2015年启动了弹性云建设项目,以Docker为核心来构建弹性云,机器统一进行池化,按需进行服务容量伸缩。随着廊坊新数据中心在10月份建设完成并投入使用,所有在线应用在新机房都迁移到了Docker容器中,成功的支持了2015的双11大促。
- 爱奇艺在基于Apache Mesos、Docker 等技术构建私有 App Engine。
- 美团云Docker
[编辑] 开发
[编辑] 服务商
[编辑] 图集
[编辑] 链接
- Docker官网
- Docker @ GitHub
- Docker for Java Developers
- Awesome Docker
- Awesome Linux Containers
- DockOne.io
- Docker for OpenStack
- Docker project infrastructure
- 解读2014之Docker篇:才气、勇气、运气
- Docker: 现在和未来
- Docker的未来,用容器代替虚拟机。
- 《使用Docker、Maven和Jenkins来做持续集成》:Docker从诞生之初就被认为可以用于自动化测试和持续集成、发布场景,本文就用Docker实现了我们经常会用到的部署操作。
- 深入浅出Docker(一):Docker核心技术预览
- 深入浅出Docker(二):Docker命令行探秘
- 深入浅出Docker(三):Docker开源之路
- 深入浅出Docker(四):Docker的集成测试部署之道
- 深入浅出Docker(五):基于Fig搭建开发环境
- Docker源码分析(一):Docker架构
- Docker源码分析(二):Docker Client创建与命令执行
- Docker:分布式系统的软件工程革命(上)
- Corekube: Running Kubernetes on CoreOS via OpenStack
- Docker将会改变Hadoop,变的更快更容易
- 《Docker开发实践》作者曾金龙:迅雷云的Docker开发实践(图灵访谈)
- Docker日志自动化: ElasticSearch、Logstash、Kibana以及Logspout
- 如何使用 Docker 组件开发 Django 项目?
- Speedy:来自京东的Docker镜像存储系统
- OpenShift V3 Deep Dive Tutorial | The Next Generation of PaaS
- 当微服务遇见容器 Docker定义存储-让应用无痛运行