lxc

How to programmatically monitor if a docker container exited?

流过昼夜 提交于 2019-12-05 03:29:22
I am running multiple named docker containers (200+) on my VM Host. I have a manager script/code that is supposed to manage the containers from the host. I would like to know if there is any event-based mechanism to get notified when a container stops/fails. So that I can restart the stopped container. One solution I could think of is doing a periodic docker inspect and looking at State.Pid or State.Running to confirm the status. But,instead of periodic polling, it would be better if the manager is notified with pid/name when a container fails so that, the particular container alone can be

What are the typical uses cases for LXC versus VM?

故事扮演 提交于 2019-12-04 20:22:02
问题 I am trying to make up my mind on when an LXC container can be a better choice than using a full VM. Do you have any precise uses cases in mind that can bring some arguments in one way or another? Are LXC more "PaaS" oriented, to run applications without hardware control? Do we always need to use VM on an "IaaS" perspective where we want infrastructure control? Regards, 回答1: I don't think IaaS needs VMs. With LXC you can define # of cpushare and Memory user limit. The thing is VMs are pretty

docker attach vs lxc-attach

做~自己de王妃 提交于 2019-12-04 19:21:18
问题 UPDATE: Docker 0.9.0 use libcontainer now, diverting from LXC see: Attaching process to Docker libcontainer container I'm running an istance of elasticsearch: docker run -d -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch Checking the process it show like the following: $ docker ps --no-trunc CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 49fdccefe4c8c72750d8155bbddad3acd8f573bf13926dcaab53c38672a62f22 dockerfile/elasticsearch:latest /usr/share/elasticsearch/bin/elasticsearch java

Is it possible to expose a USB device to an LXC/Docker container?

≡放荡痞女 提交于 2019-12-04 17:53:37
问题 I have an embedded system development image contained in a Docker file. In order to flash the code I need to connect to the nodes via USB Serial (e.g. /dev/ttyACM0 ). With Docker I used the new bind mount feature to (see https://github.com/dotcloud/docker/issues/111, -b or more recently the -v option) to expose the hosts devfs to the container. However, whenever I connect ("cat /d/ttyACM0", d is the bind mount to dev) to the device I get "operation not permitted". Is it possible to not only

CentOS-6.5离线安装docker-1.7教程

拈花ヽ惹草 提交于 2019-12-04 09:15:47
CentOS-6.5 离线安装docker-1.7 教程 0. 准备 本文是模拟实际上线时,没有网络的情况下使用rpm包安装docker-1.7的方法。不过安装中也是使用yum,相比较直接使用rpm安装,yum可以解决一些库文件的依赖关系。 # cd /etc/yum.repos.d/ # mkdir bak # mv * bak/ 1. 安装libcgroup # cd cgroup/ # yum installlibcgroup-0.40.rc1-16.el6.x86_64.rpm 2. 安装 lxc # yum installlua-filesystem-1.4.2-1.el6.x86_64.rpm lua-alt-getopt-0.7.0-1.el6.noarch.rpmlxc-libs-1.0.7-2.el6.x86_64.rpm lxc-1.0.7-2.el6.x86_64.rpmlua-lxc-1.0.7-2.el6.x86_64.rpm 3. 安装docker # yum installdocker-io-1.7.1-2.el6.x86_64.rpm 4. 更新 device-mapper-libs # yum installdevice-mapper-* 5. 设置开机自启 # chkconfig docker on 6. 检查支持情况 # lxc

How to pull a single image from any docker repository?

戏子无情 提交于 2019-12-04 08:20:39
问题 The docker repositories contains multiple images. Is it possible to just pull the specific image from Repository. When I use: docker pull ubuntu It pulls down around 8-10 different versions of ubuntu. 回答1: If there's a specific image that's tagged, you could use the --tag= (or -t) operator to pull the specific image you're looking for. There's a shorthand form for the command as well, which uses just a colon between the image name and the tag. So if you want the version of ubuntu that's

LXC with Open vSwitch

两盒软妹~` 提交于 2019-12-04 07:28:06
I want to try OVS (software Linux switch) http://openvswitch.org/ with my LXC container with Ubuntu as host and guest. So I have installed it: # apt-get install openvswitch-switch Configured according this doc https://infologs.wordpress.com/2015/06/19/how-to-attach-lxc-container-to-ovs-openvswitch/ Created test container: # lxc-create -t ubuntu -n veth03-ovs -- -r trusty Created ovs bridge and assigned IP to it: # ovs-vsctl add-br switch0 # ip add add 192.168.100.1/24 dev switch0 Let it be new network 192.168.100.0/24 and switch0 (according to my understanding) will be first address (gateway)

How to configure docker to be able to have internet access via wireless connection?

江枫思渺然 提交于 2019-12-04 02:17:51
I am trying to build a docker image by using the ones in the repository however i haven't been able to run 'apt-get update' 'apt-get install' commands because it seems that the container is not connected to the internet. I think the problem is caused by the fact that i am using a wireless connection. Is there a way to configure the docker or lxc to use the wireless network instead of the ethernet. I see two possibility: 1) Make sure your ip_forward is set to 1 ( sysctl -w net.ipv4.ip_forward=1 ) 2) Make sure it is not a DNS issue: try docker run base ping google.com , if it does not work, you

docker attach vs lxc-attach

梦想与她 提交于 2019-12-03 13:41:59
UPDATE: Docker 0.9.0 use libcontainer now, diverting from LXC see: Attaching process to Docker libcontainer container I'm running an istance of elasticsearch: docker run -d -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch Checking the process it show like the following: $ docker ps --no-trunc CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 49fdccefe4c8c72750d8155bbddad3acd8f573bf13926dcaab53c38672a62f22 dockerfile/elasticsearch:latest /usr/share/elasticsearch/bin/elasticsearch java About an hour ago Up 8 minutes 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp pensive_morse Now, when I

How is “lxd” different from lxc/docker?

旧时模样 提交于 2019-12-03 09:52:39
Questions How does lxd provide Full operating system functionality within containers, not just single processes? How is it different from lxc/docker + wrappers? Is it similar to a container that is launched with docker + supervisor/wrapper script to contain multiple processes in one container? In other words: What can I do with lxd that I cannot do with some wrappers over lxc and docker ? Why is it available only in ubuntu if they are making use of mainline kernel features (namespaces and cgroup )? Yonsy Solis How does lxd provide Full operating system functionality within containers, not just