如何在Ubuntu 18.04上安装Docker [CE和EE指南]

本文对比了Docker CE和EE的区别,并详细介绍了如何在Ubuntu 18.04上安装两者,包括从Docker官网和Docker仓库安装CE,以及使用Mirantis Launchpad CLI安装EE的步骤。
摘要由CSDN通过智能技术生成

Back in 2017, Docker introduced two different versions of its platform: Docker-CE and Docker-EE. But do you know their differences?

早在2017年 ,Docker就推出了两种不同版本的平台:Docker-CE和Docker-EE。 但是你知道他们的区别吗?

drawing

Docker CE (Community Edition) is the classical OSS (Open Source Software) Docker Engine. Includes the full Docker platform and is great for developers and DIY ops teams starting to build container apps.

Docker CE(社区版)是经典的OSS(开源软件)Docker引擎。 包括完整的Docker平台,非常适合开始构建容器应用程序的开发人员和DIY ops团队。

If you are an avid developer like I am, you've probably been using Docker for a while. And I would say that most likely this is the version you've worked with, simply because it's free!

如果您是像我这样的狂热开发人员,那么您可能已经使用Docker已有一段时间了。 我想说这很可能是您使用过的版本,仅因为它是免费的!

drawing

Docker EE, on the other hand, is a premium version of CE. It comes with all CE capabilities plus many enterprise level features.

另一方面,Docker EE是CE的高级版本。 它具有所有CE功能以及许多企业级功能

Anything that comes with premium is not free right? So it goes from $750/month basic plan to $2000/month advanced plan. Anyway the prices are on par with what you would expect from enterprise products.

保费附带的任何东西都不免费的吗? 因此它从$ 750 /月的基本计划到$ 2000 /月的高级计划。 无论如何,价格与您对企业产品的期望是一致的。

Please get in touch with their sales team to check the most up-to-date prices.
请与他们的销售团队联系以查看最新价格。

Docker CE vs EE-详细信息 (Docker CE vs EE - the Details)

Let's do a quick comparison between Docker EE and Docker CE interest over time:

让我们快速比较一下Docker EE和Docker CE的兴趣:

Now Docker EE vs Docker CE vs Docker:

现在Docker EE vs Docker CE vs Docker:

From my experience, users who are searching for just Docker are looking for the CE edition. This shows us that Docker EE is used much less. But I'm certain that there are robust use cases where it makes sense to use it.

根据我的经验,仅搜索Docker的用户正在寻找CE版本。 这向我们展示了Docker EE的使用量大大减少。 但是我敢肯定,有一些健壮的用例很有意义。

Since I'm an open source enthusiast all my experience comes from using the Docker CE edition, so writing this article was a wonderful experience getting to play with Docker EE.

由于我是一名开源爱好者,所以我的所有经验都来自使用Docker CE版本,因此撰写本文是与Docker EE一起玩的绝佳经历。

After that quick introduction, let's get our hands dirty.

快速介绍之后,让我们动手吧。

drawing

准备Ubuntu 18.04机器 (Prepare the Ubuntu 18.04 machine)

As the first step, we will get the soil ready by running some common commands.

第一步,我们将通过运行一些常见命令来准备好土壤。

All the commands will be executed on a fresh Ubuntu 18.04 machine, and this time I've chosen Google Cloud Platform as the demonstrating environment.

所有命令都将在新的Ubuntu 18.04计算机上执行,这一次,我选择了Google Cloud Platform作为演示环境。

创建虚拟机 (Create the Virtual Machine)

Let's start by creating a fresh VM using Ubuntu 18.04 image:

让我们首先使用Ubuntu 18.04映像创建一个新的VM:

gcloud compute instances create ubuntu-fcc-demo \
--zone=us-central1-c \
--machine-type=n1-standard-1 \
--image=ubuntu-minimal-1804-bionic-v20200703a \
--image-project=ubuntu-os-cloud \
--boot-disk-size=10GB \
--boot-disk-type=pd-standard

Now connect to it using ssh:

现在使用ssh连接到它:

gcloud compute ssh ubuntu-fcc-demo --zone=us-central1-c

Set up commons dependencies:

设置公共依赖项:

sudo apt-get update

sudo apt-get install \
   apt-transport-https \
   ca-certificates \
   curl \
   gnupg-agent \
   software-properties-common

在Ubuntu 18.04上安装Docker CE (Install Docker CE on Ubuntu 18.04)

从https://get.docker.com安装 (Install from https://get.docker.com)

The install script lets you quickly install the latest Docker-CE releases on the supported linux distros. I don't recommend depending on this script for deployment to production systems. From docker-install:

通过安装脚本,您可以在受支持的Linux发行版上快速安装最新的Docker-CE版本。 我不建议依赖此脚本将其部署到生产系统。 从docker-install

curl -sSL https://get.docker.com/ | sh

The beauty of this command is that it will check your linux distro and run the right instructions to get Docker CE running for you.

该命令的优点是它将检查您的Linux发行版并按照正确的说明运行Docker CE。

You can test that everything is OK by running:

您可以通过运行以下命令测试一切正常:

sudo docker run hello-world

# output
Hello from Docker!
This message shows that your installation appears to be working correctly.
drawing

从Docker仓库安装 (Install from Docker repository)

This one has more step, but is the recommended approach from Docker's official docs (we even check their GPG key fingerprint).

这一步还有更多步骤,但这是Docker官方文档推荐的方法(我们甚至检查了他们的GPG密钥Fingerprin t)。

First, add Docker’s official GPG key:

首先,添加Docker的官方GPG密钥:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| sudo apt-key add -

Then verify the key's fingerprint:

然后验证密钥的指纹:

sudo apt-key fingerprint 0EBFCD88

Look for the fingerprint 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88. This makes sure the key has not been tempered with.

寻找指纹9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 。 这样可以确保密钥没有被调整。

Next, set up a docker stable repository:

接下来,设置一个Docker 稳定存储库:

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

The  $(lsb_release -cs) command returns the Ubuntu distribution. In our case we used bionic.

$(lsb_release -cs)命令返回Ubuntu发行版。 在我们的例子中,我们使用了bionic

Now install Docker Engine:

现在安装Docker Engine:

sudo apt-get update
 sudo apt-get install docker-ce docker-ce-cli containerd.io

And test that everything is OK by running:

并通过运行以下命令测试一切正常:

sudo docker run hello-world

# output
Hello from Docker!
This message shows that your installation appears to be working correctly.
drawing

Instructions based on docs.docker.com.

基于docs.docker.com的说明。

在Ubuntu 18.04上安装Docker EE (Install Docker EE on Ubuntu 18.04 )

使用Mirantis Launchpad CLI安装 (Install using Mirantis Launchpad CLI)

To work with Docker EE you need a trial/purchased version. Docker disabled the option to get a trial subscription on their website, and now you need to contact their sales team to get a trial account.

要使用Docker EE,您需要一个试用版/购买版。 Docker禁用了在其网站上获得试用订阅的选项,现在您需要联系其销售团队以获取试用帐户

Looking around I found out that, since Mirantis acquired Docker Enterprise, the way to get a Docker EE trial account has changed. You need to go to the Mirantis website and, after applying, you can download it right away.

环顾四周,我发现,自Mirantis收购Docker Enterprise以来,获取Docker EE试用帐户的方式已经改变。 您需要访问Mirantis网站 ,申请后即可立即下载。

At the time of this writing the installer is currently beta software. If there's a different way to install Docker EE, please get in touch. I would love to improve this article!

在撰写本文时,安装程​​序当前是beta软件。 如果有其他安装Docker EE的方法,请联系。 我很乐意改善这篇文章!

The Mirantis Launchpad CLI tool ("launchpad") is the new, better way to evaluate and experience Docker Enterprise (check out launchpad GitHub).

Mirantis Launchpad CLI工具(“ launchpad ”)是评估和体验Docker Enterprise的更好的新方法(请查看launchpad GitHub )。

下载启动板CLI (Download Launchpad CLI)

Start by Downloading Launchpad. For Ubuntu 18.04 I used the launchpad-darwin-x64 version.

首先下载Launchpad 。 对于Ubuntu 18.04,我使用了launchpad-darwin-x64版本。

If you didn't download it from the Virtual Machine, here's a command to upload it to it:

如果您不是从虚拟机下载的,请使用以下命令将其上传到虚拟机:

gcloud compute scp launchpad-linux-x64 ubuntu-fcc-demo:~/launchpad \
  --zone=us-central1-c

Next, verify the installation:

接下来,验证安装:

# Give it writting permission
chmod +x launchpad

# Verify the installation
./launchpad version

# output
version: 0.12.0
commit: 4492884

Then register your user:

然后注册您的用户:

launchpad register

The information provided via registration is used to assign evaluation licenses and for providing assistance for the usage of the product.

通过注册提供的信息用于分配评估许可证,并为使用产品提供帮助。

Next, set up your  cluster.yaml config.

接下来,设置您的cluster.yaml配置。

This step was the one that took the most time for me. You need to set up 3 machines:

这一步是我花费最多时间的一步。 您需要设置3台机器:

  • Admin machine: The one where you are executing the launchpad command.

    管理机器:您正在其中执行启动板命令的机器。
  • Worker machine: Will be running your workloads.

    工作机:将运行您的工作负载。
  • Manager machine: Contains the admin dashboard, where you have access to many configs and metrics.

    管理器计算机:包含管理仪表板,您可以在其中访问许多配置和指标。

They did a great job with the Go launchpad binary. The tricky parts are within the infrastructure setup. Fortunately they already have some terraform scripts to help with it.

他们在Go launchpad二进制文件上做得很好。 棘手的部分在基础架构设置中。 幸运的是,他们已经有了一些Terraform脚本来提供帮助。

Since at the time of this writing there was no option for GCP, I had to setup the infrastructure manually. The Admin machine connects to the Worker and Manager nodes to setup many steps, so make sure you have the ssh keys correctly set up.

由于在撰写本文时,GCP尚无选择,因此我不得不手动设置基础架构。 Admin计算机连接到Worker和Manager节点以设置许多步骤,因此请确保正确设置了ssh密钥。

The ssh keys step took me some time to figure out, and I even opened an issue in their repo, but then I quickly solved it. So if you have a similar issue, make sure you check it out.

ssh keys步骤花了我一些时间来弄清楚,我什至在他们的仓库中打开了一个问题 ,但是后来我Swift解决了。 因此,如果您遇到类似的问题,请确保将其签出。

There's a really detailed documentation about each attribute you can use in the config file.

关于配置文件中可以使用的每个属性,都有非常详细的文档

Now it's time to bootstrap your cluster.

现在是时候引导您的集群了。

Once you have the cluster.yaml config set up, you can run the apply command:

设置好cluster.yaml配置后,即可运行apply命令:

launchpad --debug apply

You should see something like this:

您应该会看到以下内容:

Running phase: Install Docker EE Engine on the hosts

运行阶段:在主机上安装Docker EE Engine

This is where I can say that they did a really good job abstracting all the setup steps.

在这里我可以说他们在提取所有设置步骤方面做得非常好。

There are 37 steps that the Go launchpad binary executes.

Go launchpad二进制文件执行37个步骤。

At the end you should see a message like this:

最后,您应该看到以下消息:

INFO[0021] ==> Running phase: UCP cluster info
INFO[0021] Cluster is now configured. You can access your cluster admin UI at: https://34.71.157.231 \
INFO[0021] You can also download the admin client bundle with the following command: launchpad download-bundle --username <username> --password <password>

Now, to test that everything is OK, go into the cluster admin UI:

现在,要测试一切正常,请进入集群管理UI:

After logging in, you are presented the cluster admin UI:

登录后,将显示集群管理UI:

drawing

I played a little with some of its features, and overall they are great. They provide easy to usage Access Controls and Certified Docker images.

我玩了一些它的功能,总的来说它们很棒。 它们提供易于使用的访问控制和认证的Docker映像。

These instructions are based on this getting-started guide.

这些说明基于此入门指南

结束语 (Wrapping up)

In this article we saw how to set up Docker on Ubuntu 18.04 for both CE and EE versions.

在本文中,我们看到了如何在Ubuntu 18.04上为CE和EE版本设置Docker。

And since Mirantis has acquired Docker Enterprise, we found out that Launchpad is the latest way for customers looking to try out Docker Enterprise licenses.

而且由于Mirantis已收购Docker Enterprise ,我们发现Launchpad是寻求试用Docker Enterprise许可证的客户的最新方式。

Overall the developer/deployment experience is really good, since almost all steps to get an environment ready for Docker EE are automated. And Docker seems to be looking to increasingly automate this process, so that is really nice!

总体而言,开发人员/部署经验非常好,因为几乎所有为Docker EE准备好环境的步骤都是自动化的。 而且Docker似乎正在寻求使该过程自动化的方法,所以这真是太好了!

* Illustrations by Icons 8 from Icons8

*来自Icons8的Icons 8的插图

If you found this helpful, or wish to challenge or extend anything raised here, feel free to contact me on Twitter or Linkedin. Let's connect!

如果您认为这有帮助,或者希望挑战或扩展此处提出的任何内容,请随时通过TwitterLinkedin与我联系。 让我们连接!

翻译自: https://www.freecodecamp.org/news/how-to-install-docker-on-ubuntu-18-04-guide-for-both-ce-and-ee/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值