Depends on how you setup a container, there are several options: (1) on each new container, run "systemctl disable" for every unneeded services. OR
(2) don't use host /usr and /lib directly, but use unionfs or similar (so you have a private "copy" for each container) and uninstall any unneeded service in each container. OR (3) don't use bind mount or unionfs, but use a clone-capable fs (e.g. btrfs, zfs), and then uninstall any unneeded services in each container -- Fajar On Tue, Aug 25, 2015 at 10:16 AM, SIVA SUBRAMANIAN.P <[email protected]> wrote: > Thanks Fajar, Appreciate your effort. I'm trying to bring up systemd > container on the linux host and want to containerize only a set of systemd > services. Is there any way to restrict it? Since lib is mounted from host, > container starts all the services inside /lib/systemd/system as like in > host. > > On Tue, Aug 18, 2015 at 8:47 PM, Fajar A. Nugraha <[email protected]> wrote: >> >> Short version: you might be thinking about docker. >> >> Long version: >> >> Think of lxc as lightweight virtual machines. You'd define any >> "dependency" the same way you do on clusters of real servers: basically >> there isn't any, admins must take care of starting VMs in order and making >> sure the needed services are ready before the next one is started, or write >> their own scripts to handle the dependency. Each container would communicate >> with other containers using network, the same way it would on real servers. >> >> If all you need is a simple "VM A must be started before VM B without the >> need to check wheter the services are already running (i.e. whatever is in B >> is smart enough to wait until services in A are ready)", then lxc has >> autstart grouping and ordering. Run "man lxc.container.conf", look for >> "AUTOSTART" >> >> Docker, on the other hand, is different from lxc. It uses the same linux >> kernel capabilities as lxc, but has different user space and configuration. >> Some of the differences: >> - docker treats each container as an "application" instead of a full VM >> (so for example, typically you won't be able to "ssh" into a docker >> container) >> - docker supports dependencies between containers, either by checking a >> process, tcp port, or a custom script >> >> If you think docker is more suitable for your needs, head over to their >> website/user mailing list and ask for more info there. >> >> -- >> Fajar >> >> >> On Wed, Aug 19, 2015 at 8:12 AM, SIVA SUBRAMANIAN.P <[email protected]> >> wrote: >>> >>> Thanks Andrey for taking effort. Appreciate it. >>> Let say I want to run a application which is dependent on lighttpd >>> webservice. Can I run it outside the container where that application runs >>> and how it will communicate? >>> >>> On Tue, Aug 18, 2015 at 5:28 PM, Andrey Repin <[email protected]> >>> wrote: >>>> >>>> Greetings, SIVA SUBRAMANIAN.P! >>>> >>>> > Can some one throw light on the communication option available between >>>> > the >>>> > host and container. I'm planning to run main application in container >>>> > and all its dependencies outside it. >>>> >>>> Define "dependencies"? >>>> Without knowing, what exactly you want to do, there's no way to tell >>>> you, how >>>> you can achieve your desired result. >>>> >>>> >>>> -- >>>> With best regards, >>>> Andrey Repin >>>> Wednesday, August 19, 2015 03:27:26 >>>> >>>> Sorry for my terrible english... >>>> _______________________________________________ >>>> lxc-users mailing list >>>> [email protected] >>>> http://lists.linuxcontainers.org/listinfo/lxc-users >>> >>> >>> >>> _______________________________________________ >>> lxc-users mailing list >>> [email protected] >>> http://lists.linuxcontainers.org/listinfo/lxc-users >> >> >> >> _______________________________________________ >> lxc-users mailing list >> [email protected] >> http://lists.linuxcontainers.org/listinfo/lxc-users > > > > _______________________________________________ > lxc-users mailing list > [email protected] > http://lists.linuxcontainers.org/listinfo/lxc-users _______________________________________________ lxc-users mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-users
