Re: [lxc-users] dockerfile equivalent in LXC
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] lxc exec - cp: Value too large for defined data type
On 2016-10-05 00:41, Tomasz Chmielewski wrote: On 2016-10-05 00:05, Michael Peek wrote: I could be completely wrong about everything, but here's what I think is going on: If I'm correct then the version of cp you have inside the container was compiled without large file support enabled. What constitutes a "large" file is dependent on whether you're using a 32-bit or 64-bit system. If your container is running a 32-bit image, then a large file is any file whose size is 2GB or larger in size. For containers running a 64-bit image a large file any file of size 4GB or larger. To support large files programs usually only need to be compiled with certain compiler flags enabled to tell the compiler to activate "large file"-specific code within the source, either that or the libraries that the program depends upon need to support large files by default. The container is Ubuntu 14.04; host is Ubuntu 16.04. "cp" is copying config files. They are a few hundred bytes in size, few kilobytes maximum. So must be something else. I think it comes from the fact that the files I'm copying from were treated with setfacl on the host. And inside the container, cp is unable to recreate exactly same permissions, and outputs a confusing warning: * cp with "-a": lxd# cp -av /vagrant/0-byte-file /root '/vagrant/0-byte-file' -> '/root/0-byte-file' cp: '/vagrant/0-byte-file': Value too large for defined data type * cp without "-a": lxd# cp -v /vagrant/0-byte-file /root '/vagrant/0-byte-file' -> '/root/0-byte-file' 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
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
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
Re: [lxc-users] lxc exec - cp: Value too large for defined data type
On 2016-10-05 00:05, Michael Peek wrote: I could be completely wrong about everything, but here's what I think is going on: If I'm correct then the version of cp you have inside the container was compiled without large file support enabled. What constitutes a "large" file is dependent on whether you're using a 32-bit or 64-bit system. If your container is running a 32-bit image, then a large file is any file whose size is 2GB or larger in size. For containers running a 64-bit image a large file any file of size 4GB or larger. To support large files programs usually only need to be compiled with certain compiler flags enabled to tell the compiler to activate "large file"-specific code within the source, either that or the libraries that the program depends upon need to support large files by default. The container is Ubuntu 14.04; host is Ubuntu 16.04. "cp" is copying config files. They are a few hundred bytes in size, few kilobytes maximum. So must be something else. Tomasz Chmielewski https://lxadm.com ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
[lxc-users] dockerfile equivalent in LXC
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] lxc exec - cp: Value too large for defined data type
I could be completely wrong about everything, but here's what I think is going on: If I'm correct then the version of cp you have inside the container was compiled without large file support enabled. What constitutes a "large" file is dependent on whether you're using a 32-bit or 64-bit system. If your container is running a 32-bit image, then a large file is any file whose size is 2GB or larger in size. For containers running a 64-bit image a large file any file of size 4GB or larger. To support large files programs usually only need to be compiled with certain compiler flags enabled to tell the compiler to activate "large file"-specific code within the source, either that or the libraries that the program depends upon need to support large files by default. I can't assume your distribution, but for me, /bin/cp is in the coreutils package (Ubuntu). If I download the source for the coreutils package and compile by hand I can see that the autoconf script prints the following: checking for _LARGEFILE_SOURCE value needed for large files... no checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no [...] checking whether stdin defaults to large file offsets... yes If I understand this correctly, then this means that on my system, the underlying libraries that cp uses are compiled to handle large files already (as shown in the last line), so no compiler flag was needed for me (as shown the first three lines). But if I had needed it, then I think the appropriate flag is -D_FILE_OFFSET_BITS=64. I'd need to do some more research on that to be sure though. That may be system dependent. For reading data serially this doesn't make any difference, hence the file copied just fine and only printed out a warning. But if you tried to write a piece of C code to open the file and seek the file pointer to some point at or beyond the 2GB limit, then the seek would fail. Michael On 10/04/2016 09:30 AM, Tomasz Chmielewski wrote: > I'm getting a weird issue with cp used with "lxc exec container-name > /bin/bash /some/script.sh". > > /some/script.sh launches /some/other/script.sh, which in turn may run > some other script. > One of them is copying data with cp. > > In some cases, cp complains that "Value too large for defined data > type", for example: > > '/vagrant/scripts/provision/shell/initial_deploy/rootfs/etc/php5/pool.d/phpmyadmin.conf' > -> '/etc/php5/fpm/pool.d/phpmyadmin.conf' > '/vagrant/scripts/provision/shell/initial_deploy/rootfs/etc/php5/pool.d/www.conf' > -> '/etc/php5/fpm/pool.d/www.conf' > '/vagrant/scripts/provision/shell/initial_deploy/rootfs/etc/nginx/conf.d/default.conf' > -> '/etc/nginx/conf.d/default.conf' > cp: > '/vagrant/scripts/provision/shell/initial_deploy/rootfs/etc/nginx/conf.d/default.conf': > Value too large for defined data type > cp: > '/vagrant/scripts/provision/shell/initial_deploy/rootfs/etc/nginx/conf.d': > Value too large for defined data type > > > "/vagrant/" is a bind-mount directory within LXD: > > vagrant: > path: /vagrant > source: /home/vagrantvm/Desktop/vagrant > type: disk > > > Anyone else seeing this? > > The files are copied, just the warning is a bit strange. > > > Tomasz Chmielewski > https://lxadm.com > ___ > 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] lxc exec - cp: Value too large for defined data type
I'm getting a weird issue with cp used with "lxc exec container-name /bin/bash /some/script.sh". /some/script.sh launches /some/other/script.sh, which in turn may run some other script. One of them is copying data with cp. In some cases, cp complains that "Value too large for defined data type", for example: '/vagrant/scripts/provision/shell/initial_deploy/rootfs/etc/php5/pool.d/phpmyadmin.conf' -> '/etc/php5/fpm/pool.d/phpmyadmin.conf' '/vagrant/scripts/provision/shell/initial_deploy/rootfs/etc/php5/pool.d/www.conf' -> '/etc/php5/fpm/pool.d/www.conf' '/vagrant/scripts/provision/shell/initial_deploy/rootfs/etc/nginx/conf.d/default.conf' -> '/etc/nginx/conf.d/default.conf' cp: '/vagrant/scripts/provision/shell/initial_deploy/rootfs/etc/nginx/conf.d/default.conf': Value too large for defined data type cp: '/vagrant/scripts/provision/shell/initial_deploy/rootfs/etc/nginx/conf.d': Value too large for defined data type "/vagrant/" is a bind-mount directory within LXD: vagrant: path: /vagrant source: /home/vagrantvm/Desktop/vagrant type: disk Anyone else seeing this? The files are copied, just the warning is a bit strange. Tomasz Chmielewski https://lxadm.com ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users