博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
无需停机,手把手教您将 Docker CE 切换为 Docker EE
阅读量:5970 次
发布时间:2019-06-19

本文共 5098 字,大约阅读时间需要 16 分钟。

screenshot

出品丨Docker公司(ID:docker-cn)

编译丨小东
每周一、三、五,与您不见不散!


在最近发布的 Docker Engine 18.09 版本中,引入了一项名为“CE-EE Node Activate”的新功能。它可以让用户无缝地在现有的 Community Edition(CE)节点上执行 Enterprise 引擎的功能集,只需通过 Docker 命令行“CE-EE Node Activate”应用一个许可证,并将 Docker 引擎切换到 Enterprise 引擎即可。

screenshot

先决条件

  • Docker Community Edition(CE)版本必须为18.09或更高版本;
  • 必须安装所有 Docker 软件包:docker-cli、docker-server 和 containerd;
  • CE 和 EE 之间的节点级引擎激活仅支持 Docker Enterprise Engine for Docker 的相同版本;

测试的基础设施

  • 平台:Google Cloud Platform
  • 测试实例:1个

测试的先决条件

  • 使用 Google Cloud Engine 创建帐户(免费版);
  • 选择 Ubuntu 18.10 作为操作系统实例;

验证 Ubuntu 18.10 版本

$ cat /etc/os-releaseNAME="Ubuntu"VERSION="18.10 (Cosmic Cuttlefish)"ID=ubuntuID_LIKE=debianPRETTY_NAME="Ubuntu 18.10"VERSION_ID="18.10"HOME_URL="https://www.ubuntu.com/"SUPPORT_URL="https://help.ubuntu.com/"BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"VERSION_CODENAME=cosmicUBUNTU_CODENAME=cosmic

安装 Docker 18.09 版本

sudo apt install apt-transport-https ca-certificates curl software-properties-commoncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic test"sudo apt install docker-ce~$ sudo docker versionClient: Version:          18.09.0 API version:      1.39 Go version:       go1.10.4 Git commit:       4d60db4 Built:            Wed Nov 7 00:49:01 2018 OS/Arch:          linux/amd64 Experimental:     falseServer: Docker Engine - Community Engine: Version:         18.09.0 API version:     1.39 (minimum version 1.12) Go version:      go1.10.4 Git commit:      4d60db4 Built:           Wed Nov 7 00:16:44 2018 OS/Arch:         linux/amd64 Experimental:    false

运行 Nginx Docker 容器

$ sudo docker run -d -p 80:80 nginxUnable to find image 'nginx:latest' locallylatest: Pulling from library/nginxa5a6f2f73cd8: Pull complete67da5fbcb7a0: Pull completee82455fa5628: Pull completeDigest: sha256:31b8e90a349d1fce7621f5a5a08e4fc519b634f7d3feb09d53fac9b12aa4d991Status: Downloaded newer image for nginx:latestba4a5822d7c991c04418b2fbbcadb86057eef4d98ba3f930bff569ac8058468eCONTAINER ID       IMAGE              COMMAND                 CREATED            STATUS             PORTS               NAMESba4a5822d7c9       nginx              "nginx -g 'daemon of…"  5 seconds ago      Up 3 seconds       0.0.0.0:80->80/tcp  peaceful_swanson

验证 Nginx Docker 容器是否正常运行

~$ sudo curl localhost:80Welcome to nginx!If you see this page, the nginx web server is successfully installed andworking. Further configuration is required.For online documentation and support please refer tonginx.org.Commercial support is available atnginx.com.Thank you for using nginx.

将系统连接到 Docker Hub 帐户

$sudo docker loginLogin with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.Username: ajeetrainaPassword:WARNING! Your password will be stored unencrypted in /home/joginderkour1950/.docker/config.json.Configure a credential helper to remove this warning. Seehttps://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded

下载 Docker Enterprise 许可证

  • 浏览 下载您的 Docker Enterprise 许可证;
  • 使用您的 Docker ID 登录;
  • 在您的个人资料页面下,点击“My Content”;
  • 点击“Setup”获取 Docker Enterprise许可证;
  • 在系统中下载您的 Docker Enterprise 许可证;
  • 复制 .lic 文件的内容;
  • 在 Ubuntu 系统上创建一个名为 mylicense.lic 的文件,并将其保存在某个位置;

激活 EE 许可证

即使您的用户是 docker group 的一部分,您也必须使用sudo。

$ sudo docker engine activate --license mylicense.licLicense: Quantity: 10 Nodes    Expiration date: 2018-12-10    License is currently active18.09.0: resolved267a9a121ee1: done4365cd59d876: done [==================================================>] 1.161kB/1.161kB7ec4ee35c404: done [==================================================>]  4.55MB/4.55MB3c60d2c9ddf3: done [==================================================>] 25.71MB/25.71MB55fa4079a8ab: done [==================================================>] 1.122MB/1.122MBc5a93cbd4679: done [==================================================>] 333.9kB/333.9kBe661b0f8ba29: done [==================================================>]  4.82kB/4.82kBSuccessfully activated engine.Restart docker with 'systemctl restart docker' to complete the activation.

重新启动 Docker 服务

$ sudo systemctl restart docker

验证 Docker Enterprise 的版本

$ sudo docker versionClient: Version:          18.09.0 API version:      1.39 Go version:       go1.10.4 Git commit:       4d60db4 Built:            Wed Nov 7 00:49:01 2018 OS/Arch:          linux/amd64 Experimental:     falseServer: Docker Engine - Enterprise Engine: Version:         18.09.0 API version:     1.39 (minimum version 1.12) Go version:      go1.10.4 Git commit:      33a45cd Built:           Wed Nov 7 00:17:07 2018 OS/Arch:         linux/amd64 Experimental:    false

验证 Nginx 容器是否仍在运行

$ sudo docker psCONTAINER ID       IMAGE              COMMAND                 CREATED            STATUS             PORTS               NAMESba4a5822d7c9       nginx              "nginx -g 'daemon of…"  6 minutes ago      Up 6 minutes       0.0.0.0:80->80/tcp  peaceful_swanson

转载地址:http://eizox.baihongyu.com/

你可能感兴趣的文章
oracle 常用命令大汇总
查看>>
mysql 并行复制
查看>>
傲不可长,欲不可纵,乐不可极,志不可满——提高个人修养
查看>>
后台调用gps
查看>>
HTML5标签的语义认知和理解(1)
查看>>
MySQL日志功能详解(2)
查看>>
HP LaserJet 305X 和 339X 系列一体机如何设置手动或自动接收传真?
查看>>
XDCTF成长记录
查看>>
Linux系统中的文本处理工具
查看>>
IDE---Python IDE之Eric5在window下的安装
查看>>
Mybatis调用Oracle中的存储过程和function
查看>>
基本安装lnmp环境
查看>>
yum源资料汇总
查看>>
7、MTC与MTV,http请求介绍
查看>>
logstash消费阿里云kafka消息
查看>>
第四节课作业
查看>>
EasyUI Calendar 日历
查看>>
unix 环境高级编程
查看>>
为数据库建立索引
查看>>
第二周作业-软件工作量的估计
查看>>