本文共 5098 字,大约阅读时间需要 16 分钟。
出品丨Docker公司(ID:docker-cn)
编译丨小东每周一、三、五,与您不见不散!在最近发布的 Docker Engine 18.09 版本中,引入了一项名为“CE-EE Node Activate”的新功能。它可以让用户无缝地在现有的 Community Edition(CE)节点上执行 Enterprise 引擎的功能集,只需通过 Docker 命令行“CE-EE Node Activate”应用一个许可证,并将 Docker 引擎切换到 Enterprise 引擎即可。
$ 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
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
$ 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
~$ 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.
$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
激活 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.
$ sudo systemctl restart docker
$ 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
$ 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/