Commit graph

2125 commits

Author SHA1 Message Date
Brett Milford
a0d1a1f78c Update contrib/nuke-graph-directory.sh
Signed-off-by: Brett Milford <brettmilford@gmail.com>
2021-04-09 10:05:35 +10:00
Brett Milford
398cb1dc4f Fixes subvol delete on a non-btrfs volume
Inode numbers are guaranteed to be unique only within a filesystem.
As such there is an edge case where these predicates are true on a
non-btrfs filesystem.

Closes #42271

Signed-off-by: Brett Milford <brettmilford@gmail.com>
2021-04-08 12:09:23 +10:00
Kenta Tada
b14bf43764 check-config.sh: add SELinux and AppArmor
This commit adds the check of SELinux and AppArmor as optional features.

Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
2021-03-30 14:42:29 +09:00
Kenta Tada
1c72a68f2a check-config.sh: add SECCOMP_FILTER
The check of seccomp filter support was needed.

Ref: https://github.com/opencontainers/runc/pull/2867

Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
2021-03-23 11:16:25 +09:00
Akihiro Suda
f2f1c0fe38
dockerd-rootless-setuptool.sh: create CLI context "rootless"
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-02-26 14:43:24 +09:00
Hugo Barrera
5f6db3a077 rootless: Set service type to notify
This mirrors what the non-rootless version does, and lets `systemd` understand
when the service is fully up and running.
`NotifyAccess=all` is required, since the main process is the wrapper script,
and it's the child process that emits the signal.

Signed-off-by: Hugo Osvaldo Barrera <hugo@barrera.io>
2021-02-25 14:44:25 +01:00
Sebastiaan van Stijn
328de0b8d9
Update documentation links
- Using "/go/" redirects for some topics, which allows us to
  redirect to new locations if topics are moved around in the
  documentation.
- Updated some old URLs to their new location.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-25 12:11:50 +01:00
Sebastiaan van Stijn
33f2add9b7
Merge pull request #41960 from AkihiroSuda/rootless-typo-guard
dockerd-rootless.sh: add typo guard
2021-02-24 22:12:27 +01:00
Sebastiaan van Stijn
e8227b1f0d
Merge pull request #42034 from AkihiroSuda/prohibit-rootless-as-root
dockerd-rootless.sh: prohibit running as root
2021-02-24 22:11:20 +01:00
Akihiro Suda
8dc6c109b5
dockerd-rootless.sh: add typo guard
`dockerd-rootless.sh install` is a common typo of `dockerd-rootless-setuptool.sh install`.

Now `dockerd-rootless.sh install` shows human-readable error.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-02-24 13:54:52 +09:00
Akihiro Suda
9351e19658
dockerd-rootless.sh: prohibit running as root
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-02-24 13:21:44 +09:00
Piotr Karbowski
e8ceb97646
check-config.sh: add NETFILTER_XT_MARK
Points out another symbol that Docker might need. in this case Docker's
mesh network in swarm mode does not route Virtual IPs if it's unset.

From /var/logs/docker.log:
time="2021-02-19T18:15:39+01:00" level=error msg="set up rule failed, [-t mangle -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257]:  (iptables failed: iptables --wait -t mang
le -A INPUT
-d 10.0.1.2/32 -j MARK --set-mark 257: iptables v1.8.7 (legacy): unknown option \"--set-mark\"\nTry `iptables -h' or 'iptables --help' for more information.\n (exit status 2))"

Bug: https://github.com/moby/libnetwork/issues/2227
Bug: https://github.com/docker/for-linux/issues/644
Bug: https://github.com/docker/for-linux/issues/525
Signed-off-by: Piotr Karbowski <piotr.karbowski@protonmail.ch>
2021-02-19 20:19:36 +01:00
Akihiro Suda
05566adf71
rootless: set systemd KillMode to mixed
Now `systemctl --user stop docker` completes just with in 1 or 2 seconds.

Fix issue 41944 ("Docker rootless does not exit properly if containers are running")

See systemd.kill(5) https://www.freedesktop.org/software/systemd/man/systemd.kill.html

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-01-28 15:19:43 +09:00
Kir Kolyshkin
06d9020fac contrib/check-config.sh: fix INET_XFRM_MODE_TRANSPORT
This parameter was removed by kernel commit 4c145dce260137,
which made its way to kernel v5.3-rc1. Since that commit,
the functionality is built-in (i.e. it is available as long
as CONFIG_XFRM is on).

Make the check conditional.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-12 13:55:13 -08:00
Kir Kolyshkin
18e0543587 contrib/check-config.sh: fix IOSCHED_CFQ CFQ_GROUP_IOSCHED
These config options are removed by kernel commit f382fb0bcef4,
which made its way into kernel v5.0-rc1.

Make the check conditional.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-12 13:55:12 -08:00
Kir Kolyshkin
070f9d9dd3 contrib/check-config.sh: fix MEMCG_SWAP_ENABLED
Kernel commit 2d1c498072de69e (which made its way into kernel v5.8-rc1)
removed CONFIG_MEMCG_SWAP_ENABLED Kconfig option, making swap accounting
always enabled (unless swapaccount=0 boot option is provided).

Make the check conditional.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-12 13:55:12 -08:00
Kir Kolyshkin
03da41152a contrib/check-config.sh: fix NF_NAT_NEEDED
CONFIG_NF_NAT_NEEDED was removed in kernel commit 4806e975729f99c7,
which made its way into v5.2-rc1. The functionality is now under
NF_NAT which we already check for.

Make the check for NF_NAT_NEEDED conditional.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-12 13:55:12 -08:00
Kir Kolyshkin
eeb53c1f22 contrib/check-config.sh: fix NF_NAT_IPV4
CONFIG_NF_NAT_IPV4 was removed in kernel commit 3bf195ae6037e310,
which made its way into v5.1-rc1. The functionality is now under
NF_NAT which we already check for.

Make the check for NF_NAT_IPV4 conditional.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-12 13:55:12 -08:00
Kir Kolyshkin
76b59065ae contrib/check-config.sh: support for cgroupv2
Before:

> Generally Necessary:
> - cgroup hierarchy: nonexistent??
>     (see https://github.com/tianon/cgroupfs-mount)

After:

> Generally Necessary:
> - cgroup hierarchy: cgroupv2

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-12 13:54:54 -08:00
Sebastiaan van Stijn
5458b0e435
Revert "Add multi-user.target to After="
This reverts commit 0ca7456e52,
which caused the docker service to not be starting, or delayed
starting the service in certain conditions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-12-10 15:04:00 +01:00
Sebastiaan van Stijn
273eae8a11 Revert "systemd: add multi-user.target to After list"
This reverts commit a65c65d801,
which caused the docker service to not be starting, or delayed
starting the service in certain conditions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-12-10 14:53:03 +01:00
Akihiro Suda
ab09458e21
dockerd-rootless-setuptool.sh: show more helpful error messages
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-11-24 15:10:27 +09:00
Michał Kosek
009639e0f4 Do not "Bind" docker "To" containerd.
relates to https://github.com/docker/for-linux/issues/678

When using the BindTo directive, Docker is permanently stopped by systemd
when containerd is temporarily killed and restarted;

Using `Requires` achieves mostly the same, but defines a weaker dependency;

https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Requires=

> Requires=
>
> .. If this unit gets activated, the units listed will be activated as well.
> If one of the other units fails to activate, and an ordering dependency
> After= on the failing unit is set, this unit will not be started. Besides,
> with or without specifying After=, this unit will be stopped if one of the
> other units is explicitly stopped.

We may want to look into using `Wants=` instead of `Requires=`, because
that allows docker to continue running if containerd is restarted, quoting
the systemd documentation:

> Often, it is a better choice to use Wants= instead of Requires= in order
> to achieve a system that is more robust when dealing with failing services.

Given that docker will likely still fail if the containerd socket is not
present, startup will fail if containerd is not running, but if containerd
is restarted, the docker daemon may be able to try reconnecting.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-11-04 14:01:17 +01:00
Sebastiaan van Stijn
93bd2c1336
contrib: remove download-frozen-image-v1 script
I don't think we still had a use for this script, and if someone
needs this, it'll still be accessible in older tags/releases.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-28 16:32:00 +01:00
Brian Goff
73dc6a680c
Merge pull request #41440 from tianon/rm-mkimage.sh
Remove "mkimage.sh" and associated scripts
2020-10-20 12:19:47 -07:00
Tianon Gravi
a637034ee4
Merge pull request #41156 from AkihiroSuda/rootless-new-shim-socket-path
dockerd-rootless.sh: support new containerd shim socket path convention
2020-10-15 12:37:14 -07:00
Sebastiaan van Stijn
21578530d7 systemd: set OOMScoreAdjust for dockerd
dockerd currently sets the oom-score-adjust itself. This functionality
was added when we did not yet run dockerd as a systemd service.

Now that we do, it's better to instead have systemd handle this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-05 20:08:26 +02:00
Brian Goff
dedf8528a5 Allow download-frozen-images to work without go
Currently we use the `go` command to read GOARCH and use the value for
matching manifests.

This change allows:

1. Specifying the arch through `TARGETARCH`
2. Falling back to `dpkg` if `go` is not available
3. Falling back to `uname -m` if `dpkg` is not available
4. A default value (amd64) if none of these commands is available.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-09-28 19:10:16 +00:00
Tianon Gravi
dc72890470 Remove "mkimage.sh" and associated scripts
I looked at fixing https://bugs.debian.org/969940, but these scripts haven't been materially changed in 2-3 years and better alternatives exist elsewhere, so we should probably just remove them instead.

Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
2020-09-11 10:20:51 -07:00
Isaiah Grace
a65c65d801 systemd: add multi-user.target to After list
Signed-off-by: Isaiah Grace <irgkenya4@gmail.com>
2020-07-29 17:13:04 -04:00
Isaiah Grace
0ca7456e52 Add multi-user.target to After=
Add multi-user.target to the After= list in docker.service so that multi-user.target does not wait for docker.service (and consequently wait for network-online.target).

Signed-off-by: Isaiah Grace <irgkenya4@gmail.com>
2020-07-29 14:33:55 -04:00
wanghuaiqing
228d74842f Upgrading the versions of images in Dockerfile.
In order to run tests at mips64el device.
Now official-images has supported the following images for mips64el.
buildpack-deps:stretch
buildpack-deps:buster
debian:stretch
debian:buster

But official-images does not support the following images for mips64el.
debian:jessie
buildpack-deps:jessie

Signed-off-by: wanghuaiqing <wanghuaiqing@loongson.cn>
2020-06-30 12:24:06 +08:00
Tianon Gravi
5643da825c
Merge pull request #41148 from AkihiroSuda/remove-dm-install-bundle.sh
contrib: remove docker-machine-install-bundle.sh
2020-06-26 11:44:13 -07:00
Akihiro Suda
794aa20983
dockerd-rootless.sh: support containerd v1.4 shim socket path convention
The new shim socket path convention hardcodes `/run/containerd`:
https://github.com/containerd/containerd/pull/4343

`dockerd-rootless.sh` is updated to hide the rootful `/run/containerd`
from the mount namespace of the rootless dockerd.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-06-26 16:45:49 +09:00
Brian Goff
d0ec81dbb2
Merge pull request #41146 from AkihiroSuda/dockerd-rootless-sh-port-driver
dockerd-rootless.sh: allow specifying DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER
2020-06-25 14:21:55 -07:00
Akihiro Suda
c66c5f4904
contrib: remove docker-machine-install-bundle.sh
Docker Machine is deprecated now

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-06-24 19:46:38 +09:00
Sebastiaan van Stijn
32b4590b23
contrib: remove REVIEWERS files
We were not really using these, and they haven't been
updated in a long time. If needed, we can add people to
the CODEOWNERS file.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-24 12:12:09 +02:00
Sebastiaan van Stijn
45eb4e0d80
contrib: remove outdated vagrant docs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-24 12:09:23 +02:00
Sebastiaan van Stijn
6b6af2abd9
contrib: remove outdated "desktop-integration" examples
These Dockerfiles haven't been maintained, and more up-to-date
versions can be found in Jess's github repository;

- chromium: 3679486e0b/chromium
- gparted: 3679486e0b/gparted

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-24 12:03:21 +02:00
Akihiro Suda
6743320a12
dockerd-rootless.sh: allow specifying DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER
The default port driver "builtin" might not be always preferrable as it
drops src IP information: https://github.com/containers/libpod/pull/6324

Now the port driver can be changed to "slirp4netns" via the environment
variable `DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER`.

It is still recommended to use the default "builtin" driver.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-06-24 15:43:45 +09:00
Sebastiaan van Stijn
4609153995
Merge pull request #41098 from AkihiroSuda/rootless-safe-fallback
dockerd-rootless-setuptool.sh: use safer XRD on non-systemd hosts
2020-06-22 10:16:40 +02:00
Akihiro Suda
5d97de47ec
dockerd-rootless-setuptool.sh: use safer XRD on non-systemd hosts
`/tmp/docker-$(id -u)` is not a good candidate as `$XDG_RUNTIME_DIR`,
because it might be already created by another user.

The new path is `$HOME/.docker/run`.

Cherry-picked from https://github.com/docker/docker-install/pull/178

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-06-17 12:10:28 +09:00
Cristian Ariza
6fabb93f73 Make script pass shellcheck
Signed-off-by: Cristian Ariza <dev@cristianrz.com>
2020-06-12 17:39:29 +00:00
Brian Goff
07e6b84359
Merge pull request #40950 from AkihiroSuda/dockerd-rootless-setuptool.sh
add dockerd-rootless-setuptool.sh
2020-05-21 11:52:07 -07:00
Tianon Gravi
85dceee7d4
Merge pull request #40914 from cristianrz/40912-fix-curl-options
Fix curl progress flags
2020-05-19 12:10:25 -07:00
Akihiro Suda
c696b95269 add dockerd-rootless-setuptool.sh
Usage: `dockerd-rootless-setuptool.sh install --force` .
See `--help` for further information.

Co-authored-by: Tianon Gravi <admwiggin@gmail.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-05-15 08:46:36 +09:00
Akihiro Suda
c86abee1a4 dockerd-rootless.sh: bump up slirp4netns requirement to v0.4.0
slirp4netns v0.3.X turned out not to work with RootlessKit >= v0.7.1:
https://github.com/rootless-containers/rootlesskit/issues/143

As slirp4netns v0.3.X reached EOL on Mar 31, 2020, RootlessKit is not
going to fix support for slirp4netns v0.3.X.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-05-08 20:50:17 +09:00
cristianrz
7608e42da5 Fix curl progress flags
Signed-off-by: Cristian Ariza <dev@cristianrz.com>
2020-05-06 12:39:28 +01:00
Akihiro Suda
5ca47f5179 rootless: graduate from experimental
Close #40484

Note that the support for cgroup v2 isn't ready for production yet,
regardless to rootful or rootless.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-04-07 00:59:15 +09:00
Sebastiaan van Stijn
3e3cd7b255
Pin busybox to fixed version and verify sha256
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-03 09:55:26 +02:00
Sebastiaan van Stijn
97b742676b
hack/ci/windows.ps1: build busybox from local Dockerfile
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-03 09:32:30 +02:00
Sebastiaan van Stijn
8164f298f9
vendor jhowardmsft/busybox
taken from the 1.1 tag at https://github.com/jhowardmsft/busybox/tree/v1.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-03 09:16:05 +02:00
Akihiro Suda
1ea3a2b7f5 rootless: launch rootlesskit with --propagation=rslave
The propagation was previously set to rprivate and didn't propagate
mounts from the host mount namespace into the daemon's mount namespace.

Further information about --propagation: https://github.com/rootless-containers/rootlesskit/tree/v0.9.1#mount-propagation
RootlessKit changes: https://github.com/rootless-containers/rootlesskit/compare/v0.8.0...v0.9.1

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-07 21:16:29 +09:00
Sebastiaan van Stijn
d339e6d480 Don't disable socket activation when stopping docker service
PartOf deactivates the socket whenever the service get deactivated.
The socket unit however should be active nevertheless, so that the
docker service can be started again through socket activation.

Based on the original patch in upstream moby/moby by Max Harmathy.

Co-authored-by: Max Harmathy <max.harmathy@web.de>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-03-04 13:19:42 +01:00
Akihiro Suda
3cf82748dd run shfmt
git grep --name-only '^#!' | egrep -v '(vendor|\.go|Jenkinsfile)' | xargs shfmt -w -bn -ci -sr

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-03 12:27:49 +09:00
Akihiro Suda
7af0344f9b
Merge pull request #37470 from harmathy/patch-1
Allow socket activation
2020-03-03 10:48:21 +09:00
Akihiro Suda
9bd1ae024a dockerd-rootless.sh: remove confusing code comment
`--userland-proxy-path` is automatically set by dockerd: e6c1820ef5/cmd/dockerd/config_unix.go (L46)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-01-24 20:14:13 +09:00
Honza Pokorny
5511f45767 Remove vim syntax files
The new canonical place for the vim syntax file is in the upstream vim
tree.  All improvements and patches should be submitted there.

https://github.com/vim/vim/blob/master/runtime/syntax/dockerfile.vim

Signed-off-by: Honza Pokorny <me@honza.ca>
2020-01-14 13:01:18 -04:00
Sebastiaan van Stijn
404d87ec69
AppArmor: add missing rules for running in userns
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-30 16:17:13 +02:00
Sebastiaan van Stijn
e553a03627
AppArmor: remove rules for linkgraph.db SQLite database
Commit 0f9f99500c removed the
use of SQLite for managing container links, and commit
f8119bb7a7 removed the migration
tool, and SQLite dependency.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 17:19:21 +02:00
Kir Kolyshkin
7b0e0335bc
Fix some inefassign warnings
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-09-18 12:57:29 +02:00
Akihiro Suda
e20b7323fb rootless: harden slirp4netns with mount namespace and seccomp
When slirp4netns v0.4.0+ is used, now slirp4netns is hardened using
mount namespace ("sandbox") and seccomp to mitigate potential
vulnerabilities.

bump up rootlesskit: 2fcff6ceae...791ac8cb20

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-09-02 14:58:58 +09:00
Amit Bakshi
19a3ddf8bb
mkimage-yum.sh: Fix install of additional packages
The mkimage-yum.sh script fails to install additional
packages (passed with -p package-name), because the
package names get quoted twice.

Signed-off-by: Amit Bakshi <ambakshi@gmail.com>
2019-08-17 12:18:58 -07:00
Sebastiaan van Stijn
08191c3b90
Merge pull request #39165 from stafwag/master
Updated mkimage-arch.sh
2019-07-18 00:44:28 +02:00
Staf Wagemakers
0a1947cb9f spaces to tabs
Signed-off-by: Staf Wagemakers <staf@wagemakers.be>
2019-07-17 19:48:13 +02:00
Pascal Bach
78405559cf
Check for BRIDGE_VLAN_FILTERING in overlay section
Overlay networking in docker stack does not work correctly if this option is missing, docker will output the following error:

```
enabling default vlan on bridge br0 failed open /sys/class/net/br0/bridge/default_pvdi: permission denied
```

This because `default_pvdi` does not exist without this option.

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Simon Ausserlechner <simon.ausserlechner@siemens.com>
2019-07-16 17:32:51 +02:00
Tim
1ba4e69601 shellcheck
https://www.shellcheck.net/
Signed-off-by: Tim <elatllat@gmail.com>
2019-06-04 09:34:39 -04:00
Wiktor Kwapisiewicz
8abf26dbfb
Change docker socket location to /run/docker.sock
This change resolves the following systemd warning:

```
/usr/lib/systemd/system/docker.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/docker.sock → /run/docker.sock; please update the unit file accordingly.
```

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
2019-05-28 23:22:54 +02:00
Akihiro Suda
34cc5c24d0 dockerd-rootless.sh: use exec
Killing the shell script process does not kill the forked process.

This commit switches to `exec` so that the executed process can be
easily killed.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-05-15 20:52:59 +09:00
Staf Wagemakers
74e3edc7d1
Updated mkimage-arch.sh
* reset umask to 022
* introduced PKGREQUIRED
* introduced PKGREMOVE
  - to be able to remove linux etc on Parabola GNU/Linux
* updated PKGIGNORE
  - cryptsetup & device-mapper removed to not break the installation
  - added not required packages
* force link /etc/localtime
* install pacman-mirrorlist

Signed-off-by: Staf Wagemakers <staf@wagemakers.be>
2019-05-01 12:17:04 +02:00
Akihiro Suda
63a66b0eb0 rootless: optional support for lxc-user-nic SUID binary
lxc-user-nic can eliminate slirp overhead but needs /etc/lxc/lxc-usernet to be configured for the current user.

To use lxc-user-nic, $DOCKERD_ROOTLESS_ROOTLESSKIT_NET=lxc-user-nic also needs to be set.

This commit also bumps up RootlessKit from v0.3.0 to v0.4.0:
70e0502f32...e92d5e772e

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-04-25 23:54:30 +09:00
Sebastiaan van Stijn
0ac8cbf747
Merge pull request #39000 from mrueg/openrc-set
openrc: Modernize and sync settings
2019-04-05 19:51:37 +02:00
Tibor Vass
a0d64a3093
Merge pull request #38913 from AkihiroSuda/rootlesskit-docker-proxy
rootless: expose ports automatically
2019-04-02 19:51:15 -07:00
Manuel Rüger
275677e94f openrc: Modernize and sync settings
* Use rc_ulimit for ulimit constraints
* Synchronize ulimit settings to systemd's
* Add support for reload command
* Add support for retry settings for docker stop/restart

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2019-04-02 15:06:49 +02:00
Ankit Jain
eb13758057 Default to Core group only if no groups specified
Signed-off-by: Ankit Jain <ajatkj@yahoo.co.in>
2019-03-29 20:21:33 +05:30
Ankit Jain
8233910503 mkimage-yum.sh: handle spaces properly & allow mutiple packages & groups
Signed-off-by: Ankit Jain <ajatkj@yahoo.co.in>
2019-03-28 20:47:47 +05:30
Akihiro Suda
f0b405fbda rootless: expose ports automatically
Now `docker run -p` ports can be exposed to the host namespace automatically when `dockerd-rootless.sh` is launched with
`--userland-proxy --userland-proxy-path $(which rootlesskit-docker-proxy)`.
This is akin to how Docker for Mac/Win works with `--userland-proxy-path=/path/to/vpnkit-expose-port`.

The port number on the host namespace needs to be set to >= 1024.
SCTP ports are currently unsupported.

RootlessKit changes: 7bbbc48a6f...ed26714429

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-03-21 02:44:08 +09:00
Noriki Nakamura
57c2228cc1 Add new option to specify tag information
Previously, tag information automatically is added from
/etc/{redhat,system}-release in image (target directory).

But I want to specify any tag informtion when using mkimage-yum.sh.
Because a Linux distribution based RHEL (It's Asianux Server) uses
SPn notation (e.g. SP3) instead of period notaion (e.g. 7.6).

Signed-off-by: Noriki Nakamura <noriki.nakamura@miraclelinux.com>
2019-03-06 07:06:40 +09:00
Michael Hudson-Doyle
cfde9c717f systemd: fix typo in TasksMax comment 2019-02-27 12:49:17 +13:00
Sebastiaan van Stijn
23c763ef1c systemd: set --containerd socket patch to prevent race-condition
containerd is now running as a separate service, and should
no longer be started as a managed child-process of dockerd.

The dockerd service already specifies that it should be started
`After` the containerd.service, but there is still a race
condition, where containerd is started, but its socket is not yet
created.

In that situation, `dockerd` detects that the containerd socket
is missing, and will start a new instance of containerd (as a
managed child-process), which causes live-restore to fail.

This patch explicitly sets the `--containerd` daemon option.
If this option is set, `dockerd` will not start a new instance
of containerd.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-11 14:36:48 +01:00
Akihiro Suda
ec87479b7e allow running dockerd in an unprivileged user namespace (rootless mode)
Please refer to `docs/rootless.md`.

TLDR:
 * Make sure `/etc/subuid` and `/etc/subgid` contain the entry for you
 * `dockerd-rootless.sh --experimental`
 * `docker -H unix://$XDG_RUNTIME_DIR/docker.sock run ...`

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-02-04 00:24:27 +09:00
corbin-coleman
d021af7d2d Start docker.service after containerd.service
Signed-off-by: corbin-coleman <corbin.coleman@docker.com>
2019-01-14 23:27:51 +00:00
Mattias Jernberg
8db540370c mkimage: Fix Debian security presence check
Add Location following since security redirects to security-cdn and caused the repository to be added on Debian unstable.

Signed-off-by: Mattias Jernberg <nostrad@gmail.com>
2018-12-05 19:35:17 +01:00
Eli Uriegas
a937bc3825 Add docker.socket requirement for docker.service
Without this the docker.socket would not start by default when starting
the docker.service leading to failures to start.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-12-03 19:14:10 +00:00
Eli Uriegas
6821d80881 Add socket activation for RHEL based distributions
Removes the systemd drop-in unit file for socket activation and instead
prefers socket activation by default for both RHEL based and DEBIAN
based distributions.

Socket activation for RHEL based distributions was tested on CentOS 7 and Fedora 28.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-11-29 00:47:07 +00:00
Sebastiaan van Stijn
44e1c6ce81
Add CONFIG_IP_VS_PROTO_TCP, CONFIG_IP_VS_PROTO_UDP, IP_NF_TARGET_REDIRECT to check-config.sh
On kernels without this options set, publishing ports for swarm
services does not work, making the published port not accessible
("connection refused")

Thanks to Wenbo Wang for reporting, and Tianon for finding this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-15 11:11:48 +01:00
Eli Uriegas
07c9fef311 Add the docker.socket back in
Re-adds the docker.socket file for debian based distributions.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-11-15 00:57:19 +00:00
Mark Jeromin
60ec93f7c2 Fix error handling when go command is missing
Signed-off-by: Mark Jeromin <mark.jeromin@sysfrog.net>
2018-11-04 23:34:03 -05:00
Sebastiaan van Stijn
ce1ee59166
Merge pull request #37589 from danihodovic/update-vim-plugin-readme
README: Update Github url for vim syntax plugin
2018-10-16 14:07:52 +02:00
Valentin Kulesh
0fa3c8c277 Restore Type=notify in Systemd unit
Signed-off-by: Valentin Kulesh <valentin.kulesh@virtuozzo.com>
2018-10-08 21:51:26 +03:00
Eli Uriegas
b19e8d3319 Remove Environment, not needed anymore
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-09-26 18:15:23 +00:00
Tibor Vass
34eede0296 Remove 'docker-' prefix for containerd and runc binaries
This allows to run the daemon in environments that have upstream containerd installed.

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-09-24 21:49:03 +00:00
Eli Uriegas
212521b1e9 Use image artifacts as daemon and dependencies
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-09-21 22:03:21 +00:00
Kir Kolyshkin
14103caff2 systemd/docker.service: fix PATH
Set the PATH to what appears to be the standard on latest Ubuntu (18.04)
and Debian (9), fixing the following two issues:

1. PATH did not contain /bin (leading to ContainerTop/ps not working
on newer distros, among the other things).

2. $PATH can't be specified in Environment directives in .service files.

While at it, also:

3. Remove the comment about RPM as it looks misleading on deb-based
systems.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-09-20 10:19:35 -07:00
Eli Uriegas
ea996b88c1 Add /usr/sbin to our path variable for systemd
iptables is sometimes placed in `/usr/sbin`

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-09-17 10:16:37 -07:00
Eli Uriegas
09e8b411dc Remove offline installer to install shim-process
Removes the need for the offline installer to install the shim process
and instead installs the shim process as part of the packaging.

May be easier in the future to just package the shim process on it's own
but that'll come after this 18.09 release

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-09-10 09:10:37 +00:00
Sebastiaan van Stijn
cb95442fc7 systemd: set start burst limits
Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229
(6bf0f408e4)
both the old, and new location are accepted by systemd 229 and up, so using the old location
to make them work for either version of systemd.

StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230
(f0367da7d1)
both the old, and new name are accepted by systemd 230 and up, so using the old name to make
this option work for either version of systemd.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-31 15:19:15 +02:00
Sebastiaan van Stijn
e7ad8e2b28 systemd: add support for reloading daemon configuration through systemd
This adds support for reloading the docker daemon
(SIGHIUP) so that changes in '/etc/docker/daemon.json'
can be loaded at runtime by reloading the service
through systemd ('systemctl reload docker')

Before this change, systemd would output an error
that "reloading" is not supported for the docker
service;

  systemctl reload docker
  Failed to reload docker.service: Job type reload is not applicable for unit docker.service.

After this change, the docker daemon can be reloaded
through 'systemctl reload docker', which reloads
the configuration;

  journalctl -f -u docker.service

  May 02 03:49:20 testing systemd[1]: Reloading Docker Application Container Engine.
  May 02 03:49:20 testing docker[28496]: time="2016-05-02T03:49:20.143964103-04:00" level=info msg="Got signal to reload configuration, reloading from: /etc/docker/daemon.json"
  May 02 03:49:20 testing systemd[1]: Reloaded Docker Application Container Engine.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-31 15:11:28 +02:00
Sebastiaan van Stijn
f30757f439 systemd: set systemd KillMode
Change the kill mode to process so that systemd does not kill container
processes when the daemon is shutdown but only the docker daemon

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-31 15:11:21 +02:00
Sebastiaan van Stijn
26eddc16a8 systemd: add "Delegate=yes" to docker's service file
We need to add delegate yes to docker's service file so that it can
manage the cgroups of the processes that it launches without systemd
interfering with them and moving the processes after it is reloaded.

       Delegate=
           Turns on delegation of further resource control partitioning to
           processes of the unit. For unprivileged services (i.e. those
           using the User= setting), this allows processes to create a
           subhierarchy beneath its control group path. For privileged
           services and scopes, this ensures the processes will have all
           control group controllers enabled.

This is the proper fix for issue moby/moby#20152

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-31 15:11:16 +02:00