[lxc-users] Howto/Tutorial wanted: Running an application inside a container

Johannes Kastl mail at ojkastl.de
Sun May 11 17:38:50 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Fajar,

On 11.05.2014 07:10 Fajar A. Nugraha wrote:
> On Sun, May 11, 2014 at 1:18 AM, Johannes Kastl <mail at ojkastl.de>
> wrote: 
> https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/ is a
> good example

Sorry, but that one talks about installing a complete OS in the container:

> lxc-create -t download -n precise-gui -- -d ubuntu -r precise -a
> i386

I might have used the wrong words in my question, I was not talking
about running a complete OS, just (what I believe is called) a
application container (in contrast to a system container).

> ... and that is probably your mistake. Am I right in assuming that 
> your rootfs ONLY contains apache's config, WITHOUT any binary?

Yes.

> The container need to have ALL files/directories needed to run the 
> application.

That might be the case, but I have not got as far as running apache,
at least I thought, because of the lxc init error message...

> The easiest way would be to create a container with working  full
> OS

see above

> Personally I would NOT use lxc-execute. Had too many problems with
> it in the past. Better just use lxc-start and lxc-attach.

Thanks for the tip, I have not read that before.

> Like I mentioned above, it's easiest to just install full OS in
> the container, or bind-mount some parts of the host. If you're
> pressed for disk space, using something like btrfs/zfs
> snapshot/clone would help.

Basically I just wanted to avoid having to run a complete
installation, cos that means e.g. keeping this one up to date as well.
As disk space is not the main reason, having to run a complete OS just
kind of takes away advantages LXC has in contrast to KVM...

But bind-mounting seems like a good way, that way updates on the host
are enough...

Regards,
Johannes
- -- 
It is a mistake to think you can solve any major problems just with
potatoes.
(Douglas Adams)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/

iEYEARECAAYFAlNvtaoACgkQzi3gQ/xETbLGagCglQk3xmkbRrvLpDzE31IqveTc
qJMAnAyZDPZF0oBRxAKCiHva2NebqQFz
=K0S6
-----END PGP SIGNATURE-----



More information about the lxc-users mailing list