Commit Graph

770 Commits

Author SHA1 Message Date
Rachid Koucha
567f891596
/etc/resolv.conf grows indefinitely
This file grows indefinitely : upon each DHCP lease renew,
the "nameserver ..dns..." line is added at the end of the file.
Make a "grep" in the file to make sure that the same line
does not already exist.

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
2019-01-27 13:46:48 +01:00
Rachid Koucha
c65973ad89
Create /var/run
Some programs like "who" need this directory
to work (this permits the of /var/run/utmp file).

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
2019-01-27 12:23:58 +01:00
Rachid Koucha
4765b926b1
Use BUSYBOX_EXE variable in configure_busybox()
As "which busybox" is stored in BUSYBOX_EXE 
global variable at startup, use it wherever it is
needed.

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
2019-01-27 11:51:57 +01:00
Rachid Koucha
1c9bca6b88
Installation of default.script for udhcpc
The busybox template installs default.script in /usr/share/udhcpc/.
But the pathname of "default.script" may vary from one busybox
build to another. As the pathname is displayed in udhcpc's help,
grab it from it.

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
2019-01-27 03:38:36 +01:00
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