Docker in 100 Seconds

Docker a tool that can package software into containers that run reliably in any environment, but what is a container and why do you need one?

Let’s imagine you built up an app with cobalt that runs some weird flavor of Linux. You want to share this app with your friend but he has an entirely different system, so the problem becomes how do we replicate the environment (that) our software needs on any machine.
在这里插入图片描述
One way to package an app is with a virtual machine where hardware is simulated then installed with the required OS and dependencies.

This allows us to run multiple apps on the same infrustructure, however because each VM is runnning its own operation system, they tend to be bulky and slow.
在这里插入图片描述
在这里插入图片描述

Now a docker container is conceptually very similar to VM with one key difference. Instead of virtualizing hardware, containers only virtualize the OS, or in other words all apps or containers are run by single Kernel and this makes almost everything faster and more efficient.
在这里插入图片描述
There are three fundamental elements in the universe of docker: dockerfile, image and container.
在这里插入图片描述
The dockerfile is like DNA, it’s just code that tells docker how to build image which itself is a snapshot of your software along with all of its dependencies down to the operationg system level.

The image is immutable and and can be used to spin up multiple containers which is actual software runnng in the real world.
在这里插入图片描述
Create a docker file and use from to start from an existing template like ubuntu, this base image gets pulled down from the cloud and you can also upload your own images to a variety of different docker registries.

From there you might want to use run to run a terminal command that installs dependencies into your image.

You can set environment variables and do all kinds of other stuff, then the last thing you’ll do is set a default cmmand.
That’s ececuted when you start up a container, and now we can create the image file by running the docker build command/

It goes through each step in our docker file to build the image layer by layer. We can then bring this image to life as a container with the docker run command.
在这里插入图片描述
As your app demands more resources, you can run it on multiple machines, clouds, on-prem or whereever you want reliably. This has been docker in 100 seconds, if you enjoyed,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值