学习Docker的3个理由

学习Docker的3个理由

轻松开发,部署和分发应用程序

 

The 3 reasons you should learn Docker

Develop, Deploy, and Distribute Applications with ease

 

我认为,Docker大大改善了软件产品和平台的开发,部署和分发

In my opinion, Docker significantly improves development, deployment, and distribution of software products and platforms.

 

1)跨平台环境中的开发更容易

Development in a cross-platform environment is easier

如果您像我一样,那么您会喜欢运行OSX的Mac。问题是,我部署的大多数代码都在基于Linux的计算机上运行。

我开发的代码可以在云上运行,或者我的代码可以在Raspberry PI等嵌入式系统上运行。

 

If you are like me, you love your Mac running OSX. The problem is, most of the code that I deploy runs on Linux based

machines. I develop code to run on the cloud or I develop code to run on embedded systems like a Raspberry PI.

 

但是,我不能放弃OSX作为日常使用的操作系统和开发环境。Linux作为通用操作系统对我来说并不适合。

在我看来,这很丑陋,并且没有我一天中需要的所有应用程序。

 

However, I can’t give up OSX as my daily use operating system and development environment.

Linux just doesn’t cut it for me as a general use operating system. In my opinion,

it’s ugly and just doesn’t have all the applications I need to get through my day.

 

这样便有了Docker。我可以在本地开发环境中的OSX上开发和运行代码,但是当需要在基于Linux的平台上运行代码时,

几乎没有任何变化。实际上,由于代码依赖性,我经常会在没有Docker的情况下无法在OSX上开发代码,但是有了Docker,

我们可以在很多情况下消除这些问题。

 

So that’s where Docker comes in. I can develop and run my code on OSX in my local development environment,

but when it’s time to run my code on a Linux based platform, almost nothing changes.

In fact quite often I would never be able to develop my code on OSX without Docker due to code dependencies,

but with Docker we are able to eliminate those issues in many cases.

 

我在OSX机器上构建的完全相同的Docker映像可以在Linux上运行(假设已安装Docker引擎),从而确保了可移植性。

实际上,当您开始使用Docker注册表时,这使部署变得无缝。这是我的下一点。

 

The same exact Docker image that I build on my OSX machine can run on Linux (assuming the Docker engine is installed

of course), ensuring portability. In fact, when you start to use Docker registries, this make deployment seamless;

which is my next point.

 

2)应用程序的部署更容易 

Deployment of Applications is easier

如果您曾经尝试部署具有大量软件依赖项的软件应用程序,那么您会知道这是一个非常痛苦的过程。

在基于Linux的系统上,为了能够运行您的代码,通常会针对不同的软件项目进行大量的apt-get安装。

 

If you have ever tried to deploy a software application with a large number of software dependencies,

you know it can be a very painful process. On a Linux based system, it often involves a lot of apt-get installs for

different software projects just to be able to run your code.

 

使用Docker,所有这些依赖项都内置在映像本身中。这意味着,当您要将应用程序部署到内置于Docker映像中的应用程序时,

只需在Docker映像上安装在系统本身即可。

 

With Docker, all of those dependencies are built into the image itself. This means that when you want to deploy your

application built into a Docker image, all you need installed on the system itself is Docker plus the image.

 

这大大加快了新计算机上的部署过程,并且总体上简化了事情。通过将docker compose之类的工具连接到Docker注册表,

您可以仅使用几个命令来部署系统。

 

This significantly speeds up the deployment process on a new machine, and also simplifies things in general.

With tools such as docker compose connected to a Docker registry, you can deploy a system with just a few commands.

 

3)分发您的应用程序更容易

Distribution of Your Application is easier

如上所述,使用Docker注册表,假设您已安装Docker映像和Docker引擎,将应用程序部署到新系统非常简单。

As we mentioned above, using a docker registry, it is very straight forward to deploy an application to a new system

assuming you have the Docker image plus the Docker engine installed.

 

这使得将应用程序分发给其他人非常容易,因为您要做的就是构建一个Docker映像并将其上载到DockerHub这样的注册表中。

在很多情况下,我都用它来部署其他公司或开源项目的应用程序。由于他们已经完成了构建映像的所有工作,

因此您可以担心将其部署在系统上。

 

This makes it very easy to distribute your application to others because all you have to do is build a Docker image and

upload it to a registry such as DockerHub. I have used this in many cases to deploy applications from other companies or

open source projects. Since they have done all of the work to build the image, you can just worry about deploying it on

your system.

 

虽然我确实相信Docker是一个很棒的平台,并且可以解决许多软件问题,但它并非没有代价。

通常,编码和开发会带来额外的复杂性,尤其是当运行映像(称为容器)必须与主机操作系统进行交互时。

 

While I do believe Docker is a fantastic platform and solves many software issues, it doesn’t come without a cost.

Often the coding and development has an extra level of complexity, especially if the running image (called a container)

must interact with the host operating system.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值