Cloud, Ops & Security · Intermediate
Container
A program packed together with the environment it needs and run inside an isolated little space. Several can run side by side on one machine without interfering with each other.
TL;DRIn 30 seconds
- A program plus the environment it needs, running inside an isolated little space.
- Several can share one machine, each on its own, and one crashing doesn't drag the others down.
- Lighter than a virtual machine because it shares the host's kernel — and less strictly walled off with it.
OverviewIn detail
A container packs a program together with the environment it needs and runs the two inside an isolated little space. Several can sit side by side on one machine, each on its own rations and none interfering: one developing a problem doesn't drag its neighbour down, and whichever crashes gets restarted on its own. For whoever is using them, that isolation is a weight off the mind.
It addresses two long-standing headaches: environments that don't match, and programs fighting one another. If one program needs a library version that clashes with another's, keeping them apart removes the conflict. If one crashes, restarting that one is enough and the others keep running — no need to take the whole machine down. That's how a single machine can host a motley assortment of services, each on its own version.
You'll meet it using AI tools. Have an agent run a piece of test code and it may start a container as a scratch patch, then throw it away soil and all without dirtying your computer. When a skill description says it runs through Docker, that means starting one of these isolated boxes — if it's just a local run, you delete it afterwards and leave no trace.
Containers are often lumped in with virtual machines. A virtual machine simulates an entire computer, complete with its own operating system — heavy, but very thoroughly isolated. A container shares the host machine's kernel and packages only the program itself, which makes it far lighter and correspondingly less strictly isolated.
Two related words belong here too: an image is the template a container is started from, and a container is the running instance of that image. Docker is the tool that builds and runs them. Template, running instance, tool — three words for three things; don't mix them up.
MythsCommon misunderstandings
- ✕Thinking a container is a miniature virtual machine ✓It shares the host's kernel and packages only the program, which is why it's light — and why the isolation is less thorough
- ✕Thinking a container and an image are the same thing ✓The image is the template it starts from, the container is the running instance — one is the drawing, the other the built thing
- ✕Thinking a container going wrong will take the host with it ✓It runs separated by design — when something breaks you restart that one and the other services carry on
In practiceWhere you will meet it
- Having an AI run unverified code and watching it start a container as a scratch patch first
- Running several services on one machine, each with its own version, none disturbing the others
- Starting a service with Docker as a skill's instructions describe, then deleting it when you're done
SummaryThe key points
- Packs a program and its environment into an isolated space
- Several can share one machine without fighting
- Lighter than a virtual machine, but less strictly isolated
FAQ
What does Container mean?
A program plus the environment it needs, running inside an isolated little space.Several can share one machine, each on its own, and one crashing doesn't drag the others down.Lighter than a virtual machine because it shares the host's kernel — and less strictly walled off with it.
Where will I run into Container?
Having an AI run unverified code and watching it start a container as a scratch patch first;Running several services on one machine, each with its own version, none disturbing the others;Starting a service with Docker as a skill's instructions describe, then deleting it when you're done。
What do people most often get wrong about Container?
Thinking a container is a miniature virtual machine — but It shares the host's kernel and packages only the program, which is why it's light — and why the isolation is less thorough;Thinking a container and an image are the same thing — but The image is the template it starts from, the container is the running instance — one is the drawing, the other the built thing。
What are the key points about Container?
Packs a program and its environment into an isolated space;Several can share one machine without fighting;Lighter than a virtual machine, but less strictly isolated。
Common pitfalls A container isn't a miniature virtual machine — it shares the host's kernel.
Also written asYou may also see it written as
These are all the same concept — the same thing, however it is written in a skill description. Do not mistake different spellings for different ideas.
Entry 161 of 186 · All entries
Keep readingRelated reading
DevOps(开发运维一体化)
让写代码的和管服务器的人共用一套流程和工具,把测试、打包、上线交给机器自动完成,改完代码很快就能安全发布。
镜像(Image,软件打包模板)
把软件和它运行需要的环境一起打包好的模板,取出来在任意一台机器上都能跑出一样的结果。
HTTPS(加密网页协议)
给浏览器和网站之间的通信上锁加密,网址前面那个小锁就是它;路上有人偷看,也只能看到一串乱码。
漏洞(安全漏洞)
软件里一处能被坏人利用的缺陷,能让对方做本不该被允许的事,比如偷数据、冒充管理员或把程序弄崩。
会话(Session)
服务器用来记住这一段连续互动还是同一个人的方式;从你登录到退出之间的操作,被串成一整条记录。
Linux(操作系统)
免费开源的电脑操作系统,全球大多数服务器都在跑它;通常没有图形界面,但稳定、省资源、能长期不关机。
Where to go nextExplore more
Back to the skills themselves
Most of the concepts covered here come from skills that install into your AI client with a single command.