Commit Graph

766 Commits

Author SHA1 Message Date
Jungsub Shin
a2ade420c0 oci-template: Add logic for no /etc/passwd, group
OCI image spec dosen't specify action when there is
no /etc/passwd or /etc/group. So if there is no
/etc/passwd with string user info, set uid to 0. If there
is no /etc/group with string group info, set gid to 0.

Signed-off-by: Jungsub Shin jungsub_shin@tmax.co.kr
2018-09-28 19:24:09 +09:00
Jungsub Shin
b8cfbbd140 template: oci template supports for char user info
oci template changes character user info to uid, gid
according to OCI image spec.

Signed-off-by: Jungsub Shin jungsub_shin@tmax.co.kr
2018-09-28 10:14:06 +09:00
Christian Brauner
46a6646a83
templates: avoid endless loop
Closes #2512.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-06 16:43:35 +02:00
Thomas Hipp
8b7681f354
templates: Fix busybox template
Use `busybox --list`, and exclude the `busybox` applet if necessary.

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
2018-06-20 16:56:04 +02:00
Christian Brauner
30c8676e15
templates: fix download template
This patch fixes
commit 6e62213e02 ("templates: actually create DOWNLOAD_TEMP directory".
To use mktemp -p correctly the directories need to exist. So call mkdir -p.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-06-01 11:25:14 +02:00
Mark Asselstine
6e62213e02 templates: actually create DOWNLOAD_TEMP directory
The way 'mktemp' is currently used you will get a temp directory in
$TMPDIR or '/tmp' and DOWNLOAD_TEMP will not be pointing to an actual
directory. This will result in the wget operations failing and the
container will fail to create:

    ERROR: Failed to download http://....

Instead we want to use the '-p' option for mktemp to set the base path
and this will ensure that the temp directory is created in the correct
location and DOWNLOAD_TEMP will be consistent with this location.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
2018-05-31 16:27:05 -04:00
Felix Abecassis
8c7536ecf2 lxc-oci: mkdir the download directory
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-04-18 14:12:55 -07:00
Felix Abecassis
845ba283d6 lxc-oci: make umoci less verbose
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-29 10:21:22 -07:00
Felix Abecassis
d99e3b2ea7 lxc-oci: fix Cmd/Entrypoint parsing
Don't use the -r option of jq, since it will strip the double quotes.

Fixes: #2195
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-29 10:20:31 -07:00
Christian Brauner
ea8fa04fc8
lxc-local: add --mapped-{g,u}id flags
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:35 +01:00
Christian Brauner
4328e9e316
lxc-oci: make shellcheck clean
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:34 +01:00
Christian Brauner
a488502d83
lxc-local: coding style
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:34 +01:00
Christian Brauner
b62671d849
lxc-busybox: make shellcheck clean
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:34 +01:00
Christian Brauner
832cb1824a
lxc-download: make POSIX shellcheck clean
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:34 +01:00
Christian Brauner
b80f86f2b5
templates: bump compat level to 5
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:34 +01:00
Christian Brauner
aafb5ea2a8
tree-wide: rm templates in favor of distrobuilder
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:34 +01:00
Christian Brauner
35444f3827
templates: add lxc-local template
Closes #2184.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-26 17:22:48 +01:00
Christian Brauner
fbbe5ff5b2
lxc-oci: remove executable bit
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-26 17:04:55 +01:00
Stuart Cardall
edb5452cec
fix download template for /tmp as tmpfs or noexec
* prepend $LXC_PATH to $DOWNLOAD_TEMP on systems with /tmp mounted
  securely as a small tmpfs / noexec

* gpg_setup() creates $DOWNLOAD_TEMP so remove superflous mkdir

* fixes https://github.com/lxc/lxc/issues/516

Signed-off-by: Stuart Cardall <developer@it-offshore.co.uk>
2018-02-25 21:40:16 +00:00
Christian Brauner
941138edba
Merge pull request #2172 from stgraber/master
Sabayon fixes
2018-02-16 23:16:19 +01:00
Stéphane Graber
59ee28f21d
lxc-sabayon: Fix handling of eth0
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-02-16 16:50:45 -05:00
Stéphane Graber
9bf5cd8dbb
lxc-sabayon: Remove broken/unused code
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-02-16 16:49:02 -05:00
Christian Brauner
ff5976cd54
templates: CentOS fixes
Issues fixed:
- lxc-centos died about a missing /run directory
- lxc-centos complained about some config files it couldn't modify
- the new container got stuck at startup time for a minute
  (literally), waiting for systemd-remount-fs startup script

Of course it still works for RHEL 6, CentOS 6 and 7 as well. I did not
verify earlier CentOS or RHEL releases.

Signed-off-by: Harald Dunkel <harald.dunkel@aixigo.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-07 11:39:19 +01:00
Stéphane Graber
24d871358d
debian: We must use iproute on wheezy
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-02-01 15:44:43 +01:00
Stéphane Graber
8926686153
debian: Use iproute2 instead of iproute
The package has pretty much always been iproute2 with iproute being an
alias for it, the alias is now gone so we need to use iproute2.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-01-27 00:33:12 -05:00
Kaarle Ritvanen
ecef04af71 lxc-alpine: allow retaining sys_ptrace per container
Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
2018-01-16 16:02:49 +02:00
Stéphane Graber
71ac47aba1
gentoo: Add support for .xz tarballs
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-01-03 18:06:33 -05:00
Jonathan Calmels
9a962dc622 lxc-oci: add DHCP option leveraging dhclient hooks
Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
2017-12-19 15:18:28 -08:00
Jonathan Calmels
1689c7cf90 lxc-oci: read configuration from oci.common.conf if available
Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
2017-12-19 15:18:28 -08:00
Felix Abecassis
a787c33229 lxc-oci: add support for WorkingDir
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-12-08 20:38:43 -08:00
Felix Abecassis
8f54d926c5 lxc-oci: add IPv6 support to /etc/hosts
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-12-08 19:36:49 -08:00
Felix Abecassis
e86dcc912f lxc-oci: add basic handling of numerical uid/gid
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-12-08 19:36:40 -08:00
CC-Hsu
824d600fc1
Add new dependency to Slackware template
I followed the [changelog of Slackware-current]<http://www.slackware.com/changelog/>,
and found that Slackware-current split hostname utility from util-linux package in Nov 17 2017.
So I add the new package to the template.

Signed-off-by: Chia-Chun Hsu <a12321aabb@gmail.com>
2017-12-02 19:27:34 +08:00
Felix Abecassis
52e31c07c8 lxc-oci: support skopeo layer caching
This requires skopeo version 0.1.25

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-12-01 11:04:34 -08:00
Felix Abecassis
0fd2b67972 lxc-oci: support index files with multiple manifests
Previously, the output would contain "null" strings in this case.

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-30 22:51:57 -08:00
Felix Abecassis
ca1280fea4 lxc-oci: rely on jq instead of sed to transform values
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-30 22:51:53 -08:00
Felix Abecassis
4b42266dc6 lxc-oci: remove unhelpful comment
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-30 22:51:47 -08:00
Felix Abecassis
81e38b0059 lxc-oci: cleanup temporary download directory if umoci is interrupted
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-30 22:51:38 -08:00
Felix Abecassis
797f99c6c9 lxc-oci: add support for registry authentication
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-22 17:55:13 -08:00
Felix Abecassis
d7c685c6be lxc-oci: import common.conf and userns.conf
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-22 17:55:13 -08:00
Felix Abecassis
996202e74a lxc-oci: import the environment variables
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-22 17:55:03 -08:00
Felix Abecassis
ce59e4ca31 lxc-oci: add utility function to retrieve the path of the config file
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-22 17:53:57 -08:00
Felix Abecassis
b523655057 lxc-oci: write /etc/hosts
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-22 09:31:51 -08:00
Felix Abecassis
bc2c91ae99 lxc-oci: write /etc/hostname
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-22 09:31:51 -08:00
Felix Abecassis
51c80577e0 lxc-oci: support unprivileged umoci unpacking
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-22 09:31:51 -08:00
CC-Hsu
b79628fcfb
Add missing dependency libunistring
Hi,

I try to create a Slackware container in a Slackware64 14.2 current and
find that wget depends on libunistring.

So I add libunistring to the package list.

Closes #1915

Signed-off-by: Chia-Chun Hsu a12321aabb@gmail.com
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2017-11-10 13:17:02 -05:00
Felix Abecassis
960f15bffe lxc-oci: correctly handle --url
Fix: #1898
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-11-09 22:49:35 -08:00
Antonio Terceiro
dba285d5df lxc-debian: don't hardcode valid releases
This avoids the dance of updating the list of valid releases every time
Debian makes a new release.

It also fixes the following bug: even though lxc-debian will default to
creating containers of the latest stable by querying the archive, it
won't allow you to explicitly request `stable` because the current list
of valid releases don't include it.

Last, but not least, avoid hitting the mirror in the case the desired
release is one of the ones we know will always be there, i.e. stable,
testing, sid, and unstable.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
2017-10-28 10:32:12 -02:00
Antonio Terceiro
c99055ea6d lxc-debian: don't write C.* locales to /etc/locale.gen
Doing that confuses locale generation. lxc-ubuntu does the same check

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
2017-10-28 10:11:54 -02:00
Antonio Terceiro
61fa13293d lxc-debian: allow creating testing and unstable
Being able to create `testing` containers, regardless of what's the name
of the next stable, is useful in several contexts, included but not
limited to testing purposes. i.e. one won't need to explicitly switch to
`bullseye` once `buster` is released to be able to continue tracking
`testing`. While we are at it, let's also enable `unstable`, which is
exactly the same as `sid`, but there is no reason for not being able to.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
2017-10-26 20:48:43 -02:00