Docker:容器与本地安装

编程入门 行业动态 更新时间:2024-10-11 13:27:32
本文介绍了Docker:容器与本地安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在Docker上周末播放了Docker,并且看到从irssi,mutt,浏览器等所有的小图像,我想知道本地安装的软件包是否正在为数十个容器做出改变? / p>

我可以看到保持基本系统非常干净的好处,并且所有这些容器都是独立的,并且可以轻松地重新定位到不同的桌面,甚至Windows。每个运行一个像阿尔卑斯山这样的小型发行版。 irssi等....

这是事情正在走向还是我在这里丢失船的方式?

解决方案

Jess Frazelle 不会不同意你的意见。 在她身上博客桌面上的Docker容器,她正在集装箱化所有内容。

喜欢 Chrome本身:

$ docker run -it \ --net host \\ \\#也可以YOLO --cpuset-cpus 0 \#控制cpu --memory 512mb \#max内存,它可以使用 -v /tmp/.X11- unix:/tmp/.X11-unix \#mount X11插座 -e DISPLAY = unix $ DISPLAY \#通过显示 -v $ HOME / Downloads:/ root / Downloads \ #可选,但是 -v $ HOME / .config / google-chrome /:/ data \#如果要保存状态 --device / dev / snd \#所以我们有sound --name chrome \ jess / chrome

但是Docker容器并不仅限于这种用途,而且主要是为每个容器提供一个服务来表示稳定的,明确且可重现的执行环境的方式,您可以从开发工作站直到生产服务器。

After playing around with Docker for the first time over the week-end and seeing tiny images for everything from irssi, mutt, browsers, etc, I was wondering if local installs of packages are making way for dozens of containers instead?

I can see the benefit in keeping the base system very clean and having all these containers that are all self-contained and could be easily relocated to different desktops, even Windows. Each running a tiny distro like Alpine, with the app e.g. irssi, etc....

Is this the way things are moving towards or am I missing the boat here?

解决方案

Jess Frazelle would not disagree with you. In her blog post "Docker Containers on the Desktop", she is containerizing everything. Everything.

Like Chrome itself:

$ docker run -it \ --net host \ # may as well YOLO --cpuset-cpus 0 \ # control the cpu --memory 512mb \ # max memory it can use -v /tmp/.X11-unix:/tmp/.X11-unix \ # mount the X11 socket -e DISPLAY=unix$DISPLAY \ # pass the display -v $HOME/Downloads:/root/Downloads \ # optional, but nice -v $HOME/.config/google-chrome/:/data \ # if you want to save state --device /dev/snd \ # so we have sound --name chrome \ jess/chrome

But Docker containers are not limited to that usage, and are mainly a way to represent a stable well-defined and reproducible execution environment, for one service per container, that you can use from a development workstation up to a production server.

更多推荐

Docker:容器与本地安装

本文发布于:2023-10-29 00:21:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1538185.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:容器   Docker

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!