Skip to content

Commit 72b296d

Browse files
committed
install: improve Docker installation for openSUSE
Editing systemd unit files to customize Docker for Kata may generate conflicts with what's specified in /etc/sysconfig/docker, so use that file directly. Also, libcgroup1 dependency is wrong for newer distros, and should be pulled automatically for older ones. Signed-off-by: Marco Vedovati <[email protected]>
1 parent b2c0024 commit 72b296d

4 files changed

+24
-15
lines changed

install/docker/opensuse-docker-install.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Install Docker for Kata Containers on openSUSE Leap/Tumbleweed
1+
# Install Docker for Kata Containers on openSUSE
22

33
> **Note:**
44
>
@@ -14,24 +14,24 @@
1414
> If you wish to use a block based backend, see the options listed on https://github.com/kata-containers/documentation/issues/407.
1515
1616
```bash
17-
$ sudo zypper -n install libcgroup1
1817
$ sudo zypper -n install docker
1918
```
2019

2120
For more information on installing Docker please refer to the
2221
[Docker Guide](https://software.opensuse.org/package/docker).
2322

24-
2. Configure Docker to use Kata Containers by default with one of the following methods:
23+
2. Configure the Docker daemon to use Kata Containers by default, with one of the following methods:
2524

26-
1. systemd
25+
1. Specify the runtime options in `/etc/sysconfig/docker`:
2726

2827
```bash
29-
$ sudo mkdir -p /etc/systemd/system/docker.service.d/
30-
$ cat <<EOF | sudo tee /etc/systemd/system/docker.service.d/kata-containers.conf
31-
[Service]
32-
ExecStart=
33-
ExecStart=/usr/bin/dockerd -D --add-runtime kata-runtime=/usr/bin/kata-runtime --default-runtime=kata-runtime
34-
EOF
28+
$ DOCKER_SYSCONFIG=/etc/sysconfig/docker
29+
# Add kata-runtime to the list of available runtimes, if not already listed
30+
$ grep -qE "^ *DOCKER_OPTS=.+--add-runtime[= ] *kata-runtime" $DOCKER_SYSCONFIG || sudo -E sed -i -E "s|^( *DOCKER_OPTS=.+)\" *$|\1 --add-runtime kata-runtime=/usr/bin/kata-runtime\"|g" $DOCKER_SYSCONFIG
31+
# If a current default runtime is specified, overwrite it with kata-runtime
32+
$ sudo -E sed -i -E "s|^( *DOCKER_OPTS=.+--default-runtime[= ] *)[^ \"]+(.*\"$)|\1kata-runtime\2|g" $DOCKER_SYSCONFIG
33+
# Add kata-runtime as default runtime, if no default runtime is specified
34+
$ grep -qE "^ *DOCKER_OPTS=.+--default-runtime" $DOCKER_SYSCONFIG || sudo -E sed -i -E "s|^( *DOCKER_OPTS=.+)(\"$)|\1 --default-runtime=kata-runtime\2|g" $DOCKER_SYSCONFIG
3535
```
3636

3737
2. Docker `daemon.json`

install/opensuse-installation-guide.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Install Kata Containers on openSUSE Leap/Tumbleweed
1+
# Install Kata Containers on openSUSE
22

33
1. Install the Kata Containers components with the following commands:
44

@@ -18,6 +18,5 @@
1818
```
1919

2020
2. Decide which container manager to use and select the corresponding link that follows:
21-
2221
- [Docker](docker/opensuse-docker-install.md)
23-
- [Kubernetes](https://github.com/kata-containers/documentation/blob/master/Developer-Guide.md#run-kata-containers-with-kubernetes)
22+
- [Kubernetes](../Developer-Guide.md#run-kata-containers-with-kubernetes)

install/opensuse-leap-installation-guide.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Install Kata Containers on openSUSE Leap
22

3-
Follow the instructions in the generic [openSUSE install guide](opensuse-installation-guide.md).
3+
1. Install Kata Containers on openSUSE by following the instructions in the
4+
[openSUSE install guide](opensuse-installation-guide.md).
45
<!--
56
You can ignore the content of this comment.
67
(test code run by test-install-docs.sh to validate code blocks this document)
@@ -12,3 +13,7 @@ https://raw.githubusercontent.com/kata-containers/documentation/master/install/o
1213
Please download this file and run kata-doc-to-script.sh again."
1314
```
1415
-->
16+
17+
2. Decide which container manager to use and select the corresponding link that follows:
18+
- [Docker](docker/opensuse-leap-docker-install.md)
19+
- [Kubernetes](../Developer-Guide.md#run-kata-containers-with-kubernetes)

install/opensuse-tumbleweed-installation-guide.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Install Kata Containers on openSUSE Tumbleweed
22

3-
Follow the instructions in the generic [openSUSE install guide](opensuse-installation-guide.md).
3+
1. Install Kata Containers on openSUSE by following the instructions in the
4+
[openSUSE install guide](opensuse-installation-guide.md).
45
<!--
56
You can ignore the content of this comment.
67
(test code run by test-install-docs.sh to validate code blocks this document)
@@ -12,3 +13,7 @@ https://raw.githubusercontent.com/kata-containers/documentation/master/install/o
1213
Please download this file and run kata-doc-to-script.sh again."
1314
```
1415
-->
16+
17+
2. Decide which container manager to use and select the corresponding link that follows:
18+
- [Docker](docker/opensuse-tumbleweed-docker-install.md)
19+
- [Kubernetes](../Developer-Guide.md#run-kata-containers-with-kubernetes)

0 commit comments

Comments
 (0)