Commit Graph

4248 Commits

Author SHA1 Message Date
Stéphane Graber
e96e7a1ac7 apparmor: Allow bind-mounts and {r}shared/{r}private
Bind-mounts aren't harmful in containers, so long as they're not used to
bypass MAC policies.

This change allows bind-mounting of any path which isn't a dangerous
filesystem that's otherwise blocked by apparmor.

This also allows switching paths {r}shared or {r}private.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-06-23 16:01:29 -04:00
Stéphane Graber
f6578a7bb2 Merge pull request #1047 from brauner/mips_container
lxc-debian: allow to specify a binfmt interpreter
2016-06-13 18:36:29 -04:00
Laurent Vivier
d50cebd697 lxc-debian: allow to specify a binfmt interpreter
If you specify an interpreter path with "-I" or "--interpreter-path",
the architecture of the debian container can differ from the one of
the host.

Before creating the container, binfmt must be configured on the host:
the script checks the name of the interpreter in /proc/sys/fs/binfmt_misc/
to know where to install it in the container.

To create a MIPS container on an x86_64 host:

$ cat /proc/sys/fs/binfmt_misc/qemu-mips
enabled
interpreter //qemu-mips
flags: OC
offset 0
magic 7f454c4601020100000000000000000000020008
mask ffffffffffffff00fffffffffffffffffffeffff

$ sudo lxc-create -n virtmips-stretch -t debian -- \
                 --arch=mips \
                 --interpreter-path=./mips-linux-user/qemu-mips \
                 --mirror=http://ftp.debian.org/debian \
                 --release=stretch

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2016-06-13 22:12:54 +02:00
Serge Hallyn
56c80e0d4d Merge pull request #1045 from thtanaka/console-login-ol72
Unable to login via console in OL7.2
2016-06-09 16:38:49 -05:00
Thomas Tanaka
6efaa00c7f Unable to login via console in OL7.2
There is container-getty.service with OL7.2 systemd, it
is also used for managing the getty service, use that
instead and not manually create it.

Signed-off-by: Thomas Tanaka <thomas.tanaka@oracle.com>
2016-06-09 13:41:02 -07:00
Christian Brauner
b5cacc178e Merge pull request #1043 from stgraber/master
Drop lxc-devsetup as unneeded by current autodev
2016-06-07 21:29:52 +02:00
Stéphane Graber
7c76d6b7b7 Drop lxc-devsetup as unneeded by current autodev
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-06-07 15:11:07 -04:00
Christian Brauner
f01b8bcfe5 Merge pull request #1042 from GreatFruitOmsk/python-rpath
python-lxc: follow global rpath setting for autotools builds
2016-06-06 12:49:27 +02:00
Aleksandr Mezin
2c500c107a python-lxc: follow global rpath setting for autotools builds
When LXC is configured with --enable-rpath, I expect Python bindings
to be able to find the library in a non-standard location, just like
LXC command-line tools.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-06-06 07:50:59 +06:00
Stéphane Graber
9d54166ca5 Merge pull request #1040 from odyssey4me/include_apt_transport_https
Move apt-transport-https to global packages_template
2016-06-03 11:37:02 -04:00
Jesse Pretorius
d0e206b833 Move apt-transport-https to global packages_template
In many environments the preference is to configure containers with
apt mirrors that are SSL-secured.

When building containers using the download template this can't be
done unless an insecure mirror is first used to install the
apt-transport-https package, then the sources reconfigured to
use the https URL.

When building containers without using the download template this
can't be done unless the container creator specifically includes
this package in the package list at build time. It seems more
intuitive to me to have the package installed by default.

Commit 396f75abb3 added the package
to the minbase variant, but this variant is not used by the download
template build process. The build process instead specifies no
variant, so this patch moves the package from the packages_template
package list in the minbase variant to the global packages_template
package list, ensuring that this package is included in all Ubuntu
build images that use the lxc-ubuntu template.

Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2016-06-03 16:33:25 +01:00
Stéphane Graber
3c23f024e8 Merge pull request #1037 from evgeni/lxc.service-simple
start containers in foreground when using the lxc@.service
2016-06-02 09:44:31 -04:00
Evgeni Golov
c4e50f1d41 start containers in foreground when using the lxc@.service
lxc-start started to default to daemonize the container when starting
this conflicts with type=simple of the systemd unit

call lxc-start with -F and thus force execution in foreground
that way we can feed the log to journald properly and keep type=simple

Debian-Bug: https://bugs.debian.org/826100
Signed-off-by: Evgeni Golov <evgeni@golov.de>
2016-06-02 15:42:25 +02:00
Stéphane Graber
71e4ea52bf Merge pull request #1036 from GreatFruitOmsk/python-setuptools
python-lxc: fix breakage caused by the switch to setuptools
2016-05-31 15:40:46 -04:00
Aleksandr Mezin
0e586abd44 python-lxc: put egg-info into build directory
To keep source directory clean.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-31 17:37:08 +06:00
Aleksandr Mezin
371cffc37a python-lxc: always set --root for install command
This implies '--single-version-externally-managed', which we
actually want for autotools builds.

Fixes current problems with jenkins test suite.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-31 17:36:17 +06:00
Stéphane Graber
b4b75e16db Merge pull request #1035 from GreatFruitOmsk/python-setuptools
python-lxc: use setuptools instead of distutils
2016-05-31 00:19:29 -04:00
Aleksandr Mezin
f6ab2204b7 python-lxc: use setuptools instead of distutils
setuptools is recommended by Python Packaging Guide
https://python-packaging-user-guide.readthedocs.io/en/latest/current/

It contains some useful extensions like 'develop' command. Also it
is required for building wheels AFAIK.

The only downside is an extra build-time dependency. setuptools are
packaged in both Debian and Ubuntu (python3-setuptools), as well as
other major distros, so it shouldn't be an issue, I think.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-31 04:18:04 +06:00
Stéphane Graber
0a8fca094e Merge pull request #1034 from GreatFruitOmsk/master
python-lxc: change distribution name _lxc -> lxc
2016-05-28 15:21:16 -04:00
Aleksandr Mezin
34c4f72b01 python-lxc: change distribution name _lxc -> lxc
Distribution name starting with underscore is considered invalid by
many tools. For example, you can't list such name in
install_requires in your setup.py.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-29 01:08:55 +06:00
Stéphane Graber
df5ce2303c Merge pull request #1032 from GreatFruitOmsk/travis-vpath
travis: test VPATH builds
2016-05-27 13:56:49 -04:00
Stéphane Graber
8c041c2f68 Merge pull request #1031 from GreatFruitOmsk/pypi
python-lxc: enable standalone builds
2016-05-27 13:55:40 -04:00
Aleksandr Mezin
f2fec47531 python-lxc: search for lxc library and headers using pkg-config
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 22:23:02 +06:00
Aleksandr Mezin
43f965e015 travis: ensure 'make install' doesn't fail
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 21:56:21 +06:00
Aleksandr Mezin
6bc6062d3a travis: test VPATH builds
It looks like VPATH (split source and build directories) builds
are frequently broken. So let's test them on travis-ci.

Personally I use VPATH build in my deployment scripts.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:54:06 +06:00
Aleksandr Mezin
00d98acd9f python-lxc: pass include/library dirs as arguments to setup.py
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:05:17 +06:00
Aleksandr Mezin
58a44782d9 python-lxc: don't use private lxc/confile.h
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:05:14 +06:00
Aleksandr Mezin
0fbd2f6a89 python-lxc: don't use private lxc/utils.h
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:05:09 +06:00
Aleksandr Mezin
d51f78ed31 python-lxc: don't use private lxc/namespace.h
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-27 18:04:59 +06:00
Christian Brauner
95ca286dbd Merge pull request #1029 from joerg-krause/master
Fix redefinition of struct in6_addr
2016-05-23 21:29:49 +02:00
Jörg Krause
07d10e71d5 Fix redefinition of struct in6_addr
struct in6_addr is both defined in the C library header <netinet/in.h>
and the Linux kernel header <linux/in6.h>.

lxc_user_nic.c includes both <netinet/in.h> and <linux/if_bridge.h>. The
later one includes <linux/in6.h>.

This breaks build with the musl libc:
  error: redefinition of ‘struct in6_addr’

As lxc_user_nic.c does not use any references from <linux/if_bridge.h> it
is safe to remove this header.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
2016-05-23 20:55:46 +02:00
Stéphane Graber
7679fc22f6 Merge pull request #1022 from Lisio/master
Fix hostname in interface config for apline template
2016-05-11 16:41:00 -04:00
Andrey Kostin
1c4ea80c9e Fix hostname in interface config for apline template
Signed-off-by: Andrey Kostin <andrey@kostin.email>
2016-05-11 23:32:40 +03:00
Stéphane Graber
c563b9a29d Merge pull request #1021 from odyssey4me/include_apt_transport_https
Add apt-transport-https to minbase variant packages_template
2016-05-11 13:41:48 -04:00
Jesse Pretorius
396f75abb3 Add apt-transport-https to minbase variant packages_template
In many environments the preference is to configure containers with
apt mirrors that are SSL-secured.

When building containers using the download template this can't be
done unless an insecure mirror is first used to install the
apt-transport-https package, then the sources reconfigured to
use the https URL.

When building containers without using the download template this
can't be done unless the container creator specifically includes
this package in the package list at build time.

It seems more intuitive to me to have the package installed by
default. This patch includes the required package for the minbase
variant only as this is the default.

Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2016-05-11 18:30:39 +01:00
Christian Brauner
5832d025f5 Merge pull request #1020 from stgraber/master
Also allow fstype=fuse for fuse filesystems
2016-05-11 19:17:13 +02:00
Stéphane Graber
e6faa0670c Also allow fstype=fuse for fuse filesystems
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-05-11 12:59:23 -04:00
Christian Brauner
6b63f7a119 Merge pull request #1019 from tych0/dont-force-irmap
Dont force irmap
2016-05-11 16:47:50 +02:00
Tycho Andersen
19d1509c39 c/r: add an option to use faster inotify support in CRIU
The idea here is that criu can use open_by_handle on a configuration which
will preserve inodes on moves across hosts, but shouldn't do that on
configurations which won't preserve inodes. Before, we forced it to always
be slow, but we don't have to do this.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
2016-05-11 13:59:48 +00:00
Stéphane Graber
199cb1fe22 Merge pull request #1017 from tych0/increase-log-line-size
log: remove duplicate definitons and bump buffer size
2016-05-10 18:51:18 -04:00
Tycho Andersen
b2c3710f74 c/r: rearrange things to pass struct migrate_opts all the way down
If we don't do this, we'll end up changing the function signatures for the
internal __criu_* functions each time we add a new parameter, which will
get very annoying very quickly. Since we already have the user's arguments
struct, let's just pass that all the way down.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
2016-05-10 16:26:20 -06:00
Tycho Andersen
88593cead8 log: remove duplicate definitons and bump buffer size
When writing out the CRIU exec command, we're bumping up against the buffer
size limit. Let's increase it so we can avoid:

lxc 20160509213229.921 WARN     lxc_log - log.c:log_append_logfile:111 - truncated next event from 523 to 512 bytes

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
2016-05-10 16:24:34 -06:00
Serge Hallyn
9504f141c2 Merge pull request #1015 from stewartbrodie/confile-value-quotes
Allow configuration file values to be quoted
2016-05-10 14:16:56 -05:00
Stewart Brodie
bd878deec3 Allow configuration file values to be quoted
If the value starts and ends with matching quote characters, those
characters are stripped automatically.   Quote characters are the
single quote (') or double quote (").  The quote removal is done after
the whitespace trimming.

This is needed particularly in order that lxc.environment values may
have trailing spaces.  However, the quote removal is done for all values
in the parse_line function, as it has non-const access to the value.

Signed-off-by: Stewart Brodie <stewart@metahusky.net>
2016-05-10 13:57:00 +01:00
Christian Brauner
2bec98546e Merge pull request #1014 from hallyn/2016-05-09/procnet
Unshare netns after setting the userns mappings
2016-05-09 23:37:42 +02:00
Serge Hallyn
5b1e83cbc4 Unshare netns after setting the userns mappings
so that there is a root uid mapping for the /proc/net files.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-05-09 15:53:26 -05:00
Christian Brauner
fc5bc4a6b4 Merge pull request #1013 from hartnellfoster/bugfix_20160509
Added OR statement for cases of ID = rhel in RHEL 7+
2016-05-09 13:51:20 +02:00
Hartnell Foster
0395c47c64 Added OR statement for cases of ID = rhel in RHEL 7+
Signed-off-by: Hartnell Foster <hartnell.foster@bbc.co.uk>
2016-05-09 12:42:56 +01:00
Serge Hallyn
972765f90f Merge pull request #1008 from brauner/bugfix_branch
sync.c: use correct types
2016-05-08 22:54:20 -05:00
Christian Brauner
d38c8d1691
sync.c: use correct types
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-05-08 15:39:25 +02:00