[lxc-users] dockerfile equivalent in LXC

2016-10-06 Thread Barve, Yogesh Damodar
For creating  a docker container one can use dockerfile to specify all the 
required software installation packages and initialization, entrypoint 
directory and entrypoint command.
What will be the equivalent in the LXC world? How can one specify 
- the required packages for installations, 
- workdirectory, 
- entrypoint command,
- ports to expose and 
- volumes to mount in LXC?

Thanks in advance.

-Yogesh
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] dockerfile equivalent in LXC

2016-10-04 Thread Barve, Yogesh Damodar
This looks very promising.. Do you have more examples as to how one can use ,, 
specially the docker-compose way for multi-container approach?

-Yogesh



From: Ranjib Dey dey.ranjib at gmail.com 
Date: Tue Oct 4 15:42:30 UTC 2016 

Previous message: [lxc-users] dockerfile equivalent in LXC 
Next message: [lxc-users] dockerfile equivalent in LXC 
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] 

I have built something similar https://github.com/pagerduty/nut,
its bit buggy, and needs some more love (AST parser from docker & better
file copy, fuidshift logic).
I dont know if anything else is out there, but you can go pretty close by
just using `lxc-attach -n -- /bin/bash`and siphoning a bash script.
regards
ranjib

From: Tomasz Chmielewski [man...@wpkg.org]
Sent: Tuesday, October 04, 2016 10:53 AM
To: LXC users mailing-list
Cc: Barve, Yogesh Damodar
Subject: Re: [lxc-users] dockerfile equivalent in LXC

On 2016-10-05 00:13, Barve, Yogesh Damodar wrote:
> For creating  a docker container one can use dockerfile to specify all
> the required software installation packages and initialization,
> entrypoint directory and entrypoint command.

LXD or LXC virtualize the whole operating system, so some of these terms
don't make sense here.


> What will be the equivalent in the LXC world? How can one specify
> - the required packages for installations,

LXD installs a distribution.

For example - this one will install Ubuntu 14.04 ("Trusty"):

lxc launch images:ubuntu/trusty/amd64 some-container-name


Then, to install any packages, you can do:

lxc exec timedoctor-dev apt-get install some-package


> - workdirectory,
> - entrypoint command,

These don't make sense for LXC / LXD.


> - ports to expose and

LXC / LXD behave like proper systems with full networking.

By default, container's IP is "exposed" to the host. What you do with
it, depends on your usage case.

There are many answers to that question I guess.

1) assign a public IP to the container

2) redirect a single port to the container with iptables or a proxy


> - volumes to mount in LXC?

CONTAINER=some-container-name
MOUNTNAME=something
MOUNTPATH=/mnt/on/the/host
CONTAINERPATH=/mnt/inside/the/container
lxc config device add $CONTAINER $MOUNTNAME disk source=$MOUNTPATH
path=$CONTAINERPATH


Tomasz Chmielewski
https://lxadm.com
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] dockerfile equivalent in LXC

2016-10-04 Thread Tomasz Chmielewski

On 2016-10-05 00:13, Barve, Yogesh Damodar wrote:

For creating  a docker container one can use dockerfile to specify all
the required software installation packages and initialization,
entrypoint directory and entrypoint command.


LXD or LXC virtualize the whole operating system, so some of these terms 
don't make sense here.




What will be the equivalent in the LXC world? How can one specify
- the required packages for installations,


LXD installs a distribution.

For example - this one will install Ubuntu 14.04 ("Trusty"):

lxc launch images:ubuntu/trusty/amd64 some-container-name


Then, to install any packages, you can do:

lxc exec timedoctor-dev apt-get install some-package



- workdirectory,
- entrypoint command,


These don't make sense for LXC / LXD.



- ports to expose and


LXC / LXD behave like proper systems with full networking.

By default, container's IP is "exposed" to the host. What you do with 
it, depends on your usage case.


There are many answers to that question I guess.

1) assign a public IP to the container

2) redirect a single port to the container with iptables or a proxy



- volumes to mount in LXC?


CONTAINER=some-container-name
MOUNTNAME=something
MOUNTPATH=/mnt/on/the/host
CONTAINERPATH=/mnt/inside/the/container
lxc config device add $CONTAINER $MOUNTNAME disk source=$MOUNTPATH 
path=$CONTAINERPATH



Tomasz Chmielewski
https://lxadm.com
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] dockerfile equivalent in LXC

2016-10-04 Thread Ranjib Dey
I have built something similar https://github.com/pagerduty/nut,
its bit buggy, and needs some more love (AST parser from docker & better
file copy, fuidshift logic).
I dont know if anything else is out there, but you can go pretty close by
just using `lxc-attach -n -- /bin/bash`and siphoning a bash script.
regards
ranjib

On Tue, Oct 4, 2016 at 8:13 AM, Barve, Yogesh Damodar <
yogesh.d.ba...@vanderbilt.edu> wrote:

> For creating  a docker container one can use dockerfile to specify all the
> required software installation packages and initialization, entrypoint
> directory and entrypoint command.
> What will be the equivalent in the LXC world? How can one specify
> - the required packages for installations,
> - workdirectory,
> - entrypoint command,
> - ports to expose and
> - volumes to mount in LXC?
>
> Thanks in advance.
>
> -Yogesh
> ___
> lxc-users mailing list
> lxc-users@lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

[lxc-users] dockerfile equivalent in LXC

2016-10-04 Thread Barve, Yogesh Damodar
For creating  a docker container one can use dockerfile to specify all the 
required software installation packages and initialization, entrypoint 
directory and entrypoint command.
What will be the equivalent in the LXC world? How can one specify
- the required packages for installations,
- workdirectory,
- entrypoint command,
- ports to expose and
- volumes to mount in LXC?

Thanks in advance.

-Yogesh
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users