* [PR PATCH] docker: Fix service startup under WSL2
@ 2023-10-13 21:15 thetredev
2023-10-14 7:31 ` classabbyamp
` (27 more replies)
0 siblings, 28 replies; 29+ messages in thread
From: thetredev @ 2023-10-13 21:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]
There is a new pull request by thetredev against master on the void-packages repository
https://github.com/thetredev/void-packages docker/fix-wsl-service-startup
https://github.com/void-linux/void-packages/pull/46667
docker: Fix service startup under WSL2
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both natively and under WSL2.
A patch file from https://github.com/void-linux/void-packages/pull/46667.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-docker/fix-wsl-service-startup-46667.patch --]
[-- Type: text/x-diff, Size: 1291 bytes --]
From 8dcab2230a237e133777908aaddd7e078a1dc061 Mon Sep 17 00:00:00 2001
From: Timo Reichl <thetredev@gmail.com>
Date: Fri, 13 Oct 2023 23:06:46 +0200
Subject: [PATCH] docker: Fix service startup under WSL2
Signed-off-by: Timo Reichl <thetredev@gmail.com>
---
srcpkgs/docker-cli/template | 2 +-
srcpkgs/moby/files/docker/run | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/docker-cli/template b/srcpkgs/docker-cli/template
index 4550d3852d7da..b5e51b7cc8768 100644
--- a/srcpkgs/docker-cli/template
+++ b/srcpkgs/docker-cli/template
@@ -2,7 +2,7 @@
# should be kept in sync with moby
pkgname=docker-cli
version=24.0.6
-revision=1
+revision=2
build_style=go
go_package="github.com/docker/cli/cmd/docker"
go_import_path="github.com/docker/cli"
diff --git a/srcpkgs/moby/files/docker/run b/srcpkgs/moby/files/docker/run
index 959c22b803c58..86aca9c5d253c 100644
--- a/srcpkgs/moby/files/docker/run
+++ b/srcpkgs/moby/files/docker/run
@@ -1,7 +1,11 @@
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
-modprobe -q loop || exit 1
+
+if [ -d /lib/modules ]; then
+ modprobe -q loop || exit 1
+fi
+
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Fix service startup under WSL2
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
@ 2023-10-14 7:31 ` classabbyamp
2023-10-14 12:27 ` thetredev
` (26 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: classabbyamp @ 2023-10-14 7:31 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 235 bytes --]
New comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-1762700709
Comment:
> `xlint docker` + `./xbps-src pkg -Q docker`
how does this test the service on WSL2?
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Fix service startup under WSL2
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
2023-10-14 7:31 ` classabbyamp
@ 2023-10-14 12:27 ` thetredev
2023-10-14 14:56 ` ahesford
` (25 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2023-10-14 12:27 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
New comment by thetredev on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-1762869086
Comment:
@classabbyamp good point. I updated the PR description.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Fix service startup under WSL2
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
2023-10-14 7:31 ` classabbyamp
2023-10-14 12:27 ` thetredev
@ 2023-10-14 14:56 ` ahesford
2023-10-14 14:56 ` [PR PATCH] [Closed]: " ahesford
` (24 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: ahesford @ 2023-10-14 14:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 369 bytes --]
New comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-1762959692
Comment:
This is the wrong fix for your problem.
If the service requires `loop` to function properly, checking for the existence of `/lib/modules` is not sufficient to determine whether the needed functionally is actually available.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR PATCH] [Closed]: docker: Fix service startup under WSL2
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (2 preceding siblings ...)
2023-10-14 14:56 ` ahesford
@ 2023-10-14 14:56 ` ahesford
2023-10-14 15:02 ` ahesford
` (23 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: ahesford @ 2023-10-14 14:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3276 bytes --]
There's a closed pull request on the void-packages repository
docker: Fix service startup under WSL2
https://github.com/void-linux/void-packages/pull/46667
Description:
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
- I tested that the Docker service is working under WSL: **YES** (see below)
```
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/run"
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
modprobe -q loop || exit 1
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
}
exec chpst -o 1048576 -p 1048576 dockerd $OPTS 2>&1
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 0s, normally up, want up; run: log: (pid 170) 12s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 0s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/run"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/run"
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
if [ -d /lib/modules ]; then
modprobe -q loop || exit 1
fi
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
}
exec chpst -o 1048576 -p 1048576 dockerd $OPTS 2>&1
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
ok: run: docker: (pid 477) 0s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
run: docker: (pid 477) 2s; run: log: (pid 170) 62s
PS C:\Users\Cheeba> wsl -u root bash -ic "docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\Users\Cheeba> wsl -u root bash -ic "docker version"
Client:
Version: 24.0.6
API version: 1.43
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.7
GitCommit: UNSET
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
PS C:\Users\Cheeba>
```
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both natively and under WSL2.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Fix service startup under WSL2
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (3 preceding siblings ...)
2023-10-14 14:56 ` [PR PATCH] [Closed]: " ahesford
@ 2023-10-14 15:02 ` ahesford
2023-10-14 15:02 ` ahesford
` (22 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: ahesford @ 2023-10-14 15:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 761 bytes --]
New comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-1762960945
Comment:
Sorry, I hit the wrong spot on screen. I meant to add: If there are environments where the needed `loop` functionality is present without a module (such as your case, or when somebody builds it into a custom kernel), the right approach is probably to source a `./conf` file to check for a variable like LOAD_LOOP_MOD (or some suitably named alternative) that can gate the load attempt. To avoid breaking other installations, the module load should happen by default, e.g.,
LOAD_LOOP_MOD=yes
[ -r ./conf ] && . ./conf
case "${LOAOD_LOOP_MOD}" in
no) ;;
*) modprobe [...] ;;
esac
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Fix service startup under WSL2
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (4 preceding siblings ...)
2023-10-14 15:02 ` ahesford
@ 2023-10-14 15:02 ` ahesford
2023-10-14 15:55 ` thetredev
` (21 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: ahesford @ 2023-10-14 15:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
New comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-1762960945
Comment:
Sorry, I hit the wrong spot on screen. I meant to add: If there are environments where the needed `loop` functionality is present without a module (such as your case, or when somebody builds it into a custom kernel), the right approach is probably to source a `./conf` file to check for a variable like LOAD_LOOP_MOD (or some suitably named alternative) that can gate the load attempt. To avoid breaking other installations, the module load should happen by default,
[ -r ./conf ] && . ./conf
case "${LOAD_LOOP_MOD:-yes}" in
no) ;;
*) modprobe [...] ;;
esac
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Fix service startup under WSL2
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (5 preceding siblings ...)
2023-10-14 15:02 ` ahesford
@ 2023-10-14 15:55 ` thetredev
2023-10-14 16:00 ` [PR PATCH] [Updated] " thetredev
` (20 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2023-10-14 15:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 218 bytes --]
New comment by thetredev on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-1762994896
Comment:
@ahesford gotcha. That solution looks much cleaner. I'll update my branch.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR PATCH] [Updated] docker: Fix service startup under WSL2
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (6 preceding siblings ...)
2023-10-14 15:55 ` thetredev
@ 2023-10-14 16:00 ` thetredev
2023-10-14 16:08 ` [PR REVIEW] docker: Parameterize loading the loop kernel module ahesford
` (19 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2023-10-14 16:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3459 bytes --]
There is an updated pull request by thetredev against master on the void-packages repository
https://github.com/thetredev/void-packages docker/fix-wsl-service-startup
https://github.com/void-linux/void-packages/pull/46667
docker: Fix service startup under WSL2
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
- I tested that the Docker service is working under WSL: **YES** (see below)
```
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/run"
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
modprobe -q loop || exit 1
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
}
exec chpst -o 1048576 -p 1048576 dockerd $OPTS 2>&1
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 0s, normally up, want up; run: log: (pid 170) 12s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 0s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/run"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/run"
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
if [ -d /lib/modules ]; then
modprobe -q loop || exit 1
fi
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
}
exec chpst -o 1048576 -p 1048576 dockerd $OPTS 2>&1
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
ok: run: docker: (pid 477) 0s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
run: docker: (pid 477) 2s; run: log: (pid 170) 62s
PS C:\Users\Cheeba> wsl -u root bash -ic "docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\Users\Cheeba> wsl -u root bash -ic "docker version"
Client:
Version: 24.0.6
API version: 1.43
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.7
GitCommit: UNSET
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
PS C:\Users\Cheeba>
```
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both natively and under WSL2.
A patch file from https://github.com/void-linux/void-packages/pull/46667.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-docker/fix-wsl-service-startup-46667.patch --]
[-- Type: text/x-diff, Size: 1325 bytes --]
From 4bf9452026151b745bc74cf06cb184eca6e729e7 Mon Sep 17 00:00:00 2001
From: Timo Reichl <thetredev@gmail.com>
Date: Fri, 13 Oct 2023 23:06:46 +0200
Subject: [PATCH] docker: Parameterize loading the loop kernel module
Signed-off-by: Timo Reichl <thetredev@gmail.com>
---
srcpkgs/docker-cli/template | 2 +-
srcpkgs/moby/files/docker/run | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/docker-cli/template b/srcpkgs/docker-cli/template
index 4550d3852d7da..b5e51b7cc8768 100644
--- a/srcpkgs/docker-cli/template
+++ b/srcpkgs/docker-cli/template
@@ -2,7 +2,7 @@
# should be kept in sync with moby
pkgname=docker-cli
version=24.0.6
-revision=1
+revision=2
build_style=go
go_package="github.com/docker/cli/cmd/docker"
go_import_path="github.com/docker/cli"
diff --git a/srcpkgs/moby/files/docker/run b/srcpkgs/moby/files/docker/run
index 959c22b803c58..386830059f770 100644
--- a/srcpkgs/moby/files/docker/run
+++ b/srcpkgs/moby/files/docker/run
@@ -1,7 +1,10 @@
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
-modprobe -q loop || exit 1
+case "${LOAD_LOOP_MODULE:-yes}" in
+ no) ;;
+ *) modprobe -q loop || exit 1 ;;
+esac
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR REVIEW] docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (7 preceding siblings ...)
2023-10-14 16:00 ` [PR PATCH] [Updated] " thetredev
@ 2023-10-14 16:08 ` ahesford
2023-10-14 16:08 ` thetredev
` (18 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: ahesford @ 2023-10-14 16:08 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 227 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#discussion_r1359470410
Comment:
Looks like you bumped the wrong package; it should be `moby` that gets bumped.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR REVIEW] docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (8 preceding siblings ...)
2023-10-14 16:08 ` [PR REVIEW] docker: Parameterize loading the loop kernel module ahesford
@ 2023-10-14 16:08 ` thetredev
2023-10-14 16:11 ` [PR PATCH] [Updated] " thetredev
` (17 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2023-10-14 16:08 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 172 bytes --]
New review comment by thetredev on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#discussion_r1359471364
Comment:
Oops, thanks. Will do.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR PATCH] [Updated] docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (9 preceding siblings ...)
2023-10-14 16:08 ` thetredev
@ 2023-10-14 16:11 ` thetredev
2023-10-14 16:11 ` [PR REVIEW] " thetredev
` (16 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2023-10-14 16:11 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3649 bytes --]
There is an updated pull request by thetredev against master on the void-packages repository
https://github.com/thetredev/void-packages docker/fix-wsl-service-startup
https://github.com/void-linux/void-packages/pull/46667
docker: Parameterize loading the loop kernel module
These changes introduce a config variable `LOAD_LOOP_MODULE` which can be set to `yes` (default) or `no` within the `/etc/docker/sv/conf` file.
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
- I tested that the Docker service is working when the `loop` kernel module is not required (e.g. under WSL): **YES** (see below)
```
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
cat: /etc/sv/docker/conf: No such file or directory
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 1s, normally up, want up; run: log: (pid 170) 3s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=yes
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 0s, normally up, want up; run: log: (pid 170) 35s
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=no
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
ok: run: docker: (pid 479) 1s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
run: docker: (pid 479) 2s; run: log: (pid 170) 45s
PS C:\Users\Cheeba> wsl -u root bash -ic "docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\Users\Cheeba> wsl -u root bash -ic "docker version"
Client:
Version: 24.0.6
API version: 1.43
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.7
GitCommit: UNSET
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
PS C:\Users\Cheeba>
```
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both when the `loop` module is available and has to be loaded (default), as well as in systems where it's not available or not required, like WSL2.
A patch file from https://github.com/void-linux/void-packages/pull/46667.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-docker/fix-wsl-service-startup-46667.patch --]
[-- Type: text/x-diff, Size: 1327 bytes --]
From 09cc0f1c689d1812353a1ba71cd1ff05b41a5d73 Mon Sep 17 00:00:00 2001
From: Timo Reichl <thetredev@gmail.com>
Date: Sat, 14 Oct 2023 18:11:24 +0200
Subject: [PATCH] docker: Parameterize loading the loop kernel module
Signed-off-by: Timo Reichl <thetredev@gmail.com>
---
srcpkgs/moby/files/docker/run | 5 ++++-
srcpkgs/moby/template | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/moby/files/docker/run b/srcpkgs/moby/files/docker/run
index 959c22b803c58..386830059f770 100644
--- a/srcpkgs/moby/files/docker/run
+++ b/srcpkgs/moby/files/docker/run
@@ -1,7 +1,10 @@
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
-modprobe -q loop || exit 1
+case "${LOAD_LOOP_MODULE:-yes}" in
+ no) ;;
+ *) modprobe -q loop || exit 1 ;;
+esac
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
diff --git a/srcpkgs/moby/template b/srcpkgs/moby/template
index fc1d6e34e4efb..9bd2f59083e67 100644
--- a/srcpkgs/moby/template
+++ b/srcpkgs/moby/template
@@ -2,7 +2,7 @@
# should be kept in sync with docker-cli
pkgname=moby
version=24.0.6
-revision=1
+revision=2
# libnetwork commit is mentioned in vendor.conf
_libnetwork_commit=05b93e0d3a95952f70c113b0bc5bdb538d7afdd7
create_wrksrc=yes
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR REVIEW] docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (10 preceding siblings ...)
2023-10-14 16:11 ` [PR PATCH] [Updated] " thetredev
@ 2023-10-14 16:11 ` thetredev
2023-10-14 16:13 ` thetredev
` (15 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2023-10-14 16:11 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 154 bytes --]
New review comment by thetredev on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#discussion_r1359473671
Comment:
done
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (11 preceding siblings ...)
2023-10-14 16:11 ` [PR REVIEW] " thetredev
@ 2023-10-14 16:13 ` thetredev
2023-10-14 16:26 ` thetredev
` (14 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2023-10-14 16:13 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 211 bytes --]
New comment by thetredev on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-1763027616
Comment:
Updated the PR description yet again to reflect the latest changes.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (12 preceding siblings ...)
2023-10-14 16:13 ` thetredev
@ 2023-10-14 16:26 ` thetredev
2024-03-09 22:53 ` [PR PATCH] [Updated] " thetredev
` (13 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2023-10-14 16:26 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 211 bytes --]
New comment by thetredev on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-1763027616
Comment:
Updated the PR title and description to reflect the latest changes.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR PATCH] [Updated] docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (13 preceding siblings ...)
2023-10-14 16:26 ` thetredev
@ 2024-03-09 22:53 ` thetredev
2024-03-09 22:53 ` thetredev
` (12 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-03-09 22:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3649 bytes --]
There is an updated pull request by thetredev against master on the void-packages repository
https://github.com/thetredev/void-packages docker/fix-wsl-service-startup
https://github.com/void-linux/void-packages/pull/46667
docker: Parameterize loading the loop kernel module
These changes introduce a config variable `LOAD_LOOP_MODULE` which can be set to `yes` (default) or `no` within the `/etc/docker/sv/conf` file.
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
- I tested that the Docker service is working when the `loop` kernel module is not required (e.g. under WSL): **YES** (see below)
```
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
cat: /etc/sv/docker/conf: No such file or directory
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 1s, normally up, want up; run: log: (pid 170) 3s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=yes
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 0s, normally up, want up; run: log: (pid 170) 35s
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=no
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
ok: run: docker: (pid 479) 1s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
run: docker: (pid 479) 2s; run: log: (pid 170) 45s
PS C:\Users\Cheeba> wsl -u root bash -ic "docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\Users\Cheeba> wsl -u root bash -ic "docker version"
Client:
Version: 24.0.6
API version: 1.43
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.7
GitCommit: UNSET
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
PS C:\Users\Cheeba>
```
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both when the `loop` module is available and has to be loaded (default), as well as in systems where it's not available or not required, like WSL2.
A patch file from https://github.com/void-linux/void-packages/pull/46667.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-docker/fix-wsl-service-startup-46667.patch --]
[-- Type: text/x-diff, Size: 1331 bytes --]
From 7a0e1291d3a4980f1259c77fac6997bfbaaca5df Mon Sep 17 00:00:00 2001
From: Timo Reichl <thetredev@gmail.com>
Date: Sat, 14 Oct 2023 18:11:24 +0200
Subject: [PATCH] docker: Parameterize loading the loop kernel module
Signed-off-by: Timo Reichl <thetredev@gmail.com>
---
srcpkgs/moby/files/docker/run | 5 ++++-
srcpkgs/moby/template | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/moby/files/docker/run b/srcpkgs/moby/files/docker/run
index 959c22b803c587..386830059f7700 100644
--- a/srcpkgs/moby/files/docker/run
+++ b/srcpkgs/moby/files/docker/run
@@ -1,7 +1,10 @@
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
-modprobe -q loop || exit 1
+case "${LOAD_LOOP_MODULE:-yes}" in
+ no) ;;
+ *) modprobe -q loop || exit 1 ;;
+esac
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
diff --git a/srcpkgs/moby/template b/srcpkgs/moby/template
index 2aa2e426b02597..1cfb875de630a3 100644
--- a/srcpkgs/moby/template
+++ b/srcpkgs/moby/template
@@ -2,7 +2,7 @@
# should be kept in sync with docker-cli
pkgname=moby
version=25.0.3
-revision=1
+revision=2
# libnetwork commit is mentioned in vendor.conf
_libnetwork_commit=05b93e0d3a95952f70c113b0bc5bdb538d7afdd7
create_wrksrc=yes
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (14 preceding siblings ...)
2024-03-09 22:53 ` [PR PATCH] [Updated] " thetredev
@ 2024-03-09 22:53 ` thetredev
2024-03-11 0:25 ` [PR PATCH] [Updated] " thetredev
` (11 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-03-09 22:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 175 bytes --]
New comment by thetredev on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-1987001743
Comment:
Rebased to latest master again.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR PATCH] [Updated] docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (15 preceding siblings ...)
2024-03-09 22:53 ` thetredev
@ 2024-03-11 0:25 ` thetredev
2024-03-11 0:30 ` thetredev
` (10 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-03-11 0:25 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3649 bytes --]
There is an updated pull request by thetredev against master on the void-packages repository
https://github.com/thetredev/void-packages docker/fix-wsl-service-startup
https://github.com/void-linux/void-packages/pull/46667
docker: Parameterize loading the loop kernel module
These changes introduce a config variable `LOAD_LOOP_MODULE` which can be set to `yes` (default) or `no` within the `/etc/docker/sv/conf` file.
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
- I tested that the Docker service is working when the `loop` kernel module is not required (e.g. under WSL): **YES** (see below)
```
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
cat: /etc/sv/docker/conf: No such file or directory
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 1s, normally up, want up; run: log: (pid 170) 3s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=yes
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 0s, normally up, want up; run: log: (pid 170) 35s
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=no
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
ok: run: docker: (pid 479) 1s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
run: docker: (pid 479) 2s; run: log: (pid 170) 45s
PS C:\Users\Cheeba> wsl -u root bash -ic "docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\Users\Cheeba> wsl -u root bash -ic "docker version"
Client:
Version: 24.0.6
API version: 1.43
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.7
GitCommit: UNSET
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
PS C:\Users\Cheeba>
```
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both when the `loop` module is available and has to be loaded (default), as well as in systems where it's not available or not required, like WSL2.
A patch file from https://github.com/void-linux/void-packages/pull/46667.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-docker/fix-wsl-service-startup-46667.patch --]
[-- Type: text/x-diff, Size: 1331 bytes --]
From 7a0e1291d3a4980f1259c77fac6997bfbaaca5df Mon Sep 17 00:00:00 2001
From: Timo Reichl <thetredev@gmail.com>
Date: Sat, 14 Oct 2023 18:11:24 +0200
Subject: [PATCH] docker: Parameterize loading the loop kernel module
Signed-off-by: Timo Reichl <thetredev@gmail.com>
---
srcpkgs/moby/files/docker/run | 5 ++++-
srcpkgs/moby/template | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/moby/files/docker/run b/srcpkgs/moby/files/docker/run
index 959c22b803c587..386830059f7700 100644
--- a/srcpkgs/moby/files/docker/run
+++ b/srcpkgs/moby/files/docker/run
@@ -1,7 +1,10 @@
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
-modprobe -q loop || exit 1
+case "${LOAD_LOOP_MODULE:-yes}" in
+ no) ;;
+ *) modprobe -q loop || exit 1 ;;
+esac
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
diff --git a/srcpkgs/moby/template b/srcpkgs/moby/template
index 2aa2e426b02597..1cfb875de630a3 100644
--- a/srcpkgs/moby/template
+++ b/srcpkgs/moby/template
@@ -2,7 +2,7 @@
# should be kept in sync with docker-cli
pkgname=moby
version=25.0.3
-revision=1
+revision=2
# libnetwork commit is mentioned in vendor.conf
_libnetwork_commit=05b93e0d3a95952f70c113b0bc5bdb538d7afdd7
create_wrksrc=yes
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR PATCH] [Updated] docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (16 preceding siblings ...)
2024-03-11 0:25 ` [PR PATCH] [Updated] " thetredev
@ 2024-03-11 0:30 ` thetredev
2024-06-09 1:52 ` github-actions
` (9 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-03-11 0:30 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3649 bytes --]
There is an updated pull request by thetredev against master on the void-packages repository
https://github.com/thetredev/void-packages docker/fix-wsl-service-startup
https://github.com/void-linux/void-packages/pull/46667
docker: Parameterize loading the loop kernel module
These changes introduce a config variable `LOAD_LOOP_MODULE` which can be set to `yes` (default) or `no` within the `/etc/docker/sv/conf` file.
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
- I tested that the Docker service is working when the `loop` kernel module is not required (e.g. under WSL): **YES** (see below)
```
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
cat: /etc/sv/docker/conf: No such file or directory
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 1s, normally up, want up; run: log: (pid 170) 3s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=yes
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 0s, normally up, want up; run: log: (pid 170) 35s
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=no
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
ok: run: docker: (pid 479) 1s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
run: docker: (pid 479) 2s; run: log: (pid 170) 45s
PS C:\Users\Cheeba> wsl -u root bash -ic "docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\Users\Cheeba> wsl -u root bash -ic "docker version"
Client:
Version: 24.0.6
API version: 1.43
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.7
GitCommit: UNSET
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
PS C:\Users\Cheeba>
```
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both when the `loop` module is available and has to be loaded (default), as well as in systems where it's not available or not required, like WSL2.
A patch file from https://github.com/void-linux/void-packages/pull/46667.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-docker/fix-wsl-service-startup-46667.patch --]
[-- Type: text/x-diff, Size: 1331 bytes --]
From a70bf408f89d5f2baf752845a9b742a2111aab4b Mon Sep 17 00:00:00 2001
From: Timo Reichl <thetredev@gmail.com>
Date: Sat, 14 Oct 2023 18:11:24 +0200
Subject: [PATCH] docker: Parameterize loading the loop kernel module
Signed-off-by: Timo Reichl <thetredev@gmail.com>
---
srcpkgs/moby/files/docker/run | 5 ++++-
srcpkgs/moby/template | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/moby/files/docker/run b/srcpkgs/moby/files/docker/run
index 959c22b803c587..386830059f7700 100644
--- a/srcpkgs/moby/files/docker/run
+++ b/srcpkgs/moby/files/docker/run
@@ -1,7 +1,10 @@
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
-modprobe -q loop || exit 1
+case "${LOAD_LOOP_MODULE:-yes}" in
+ no) ;;
+ *) modprobe -q loop || exit 1 ;;
+esac
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
diff --git a/srcpkgs/moby/template b/srcpkgs/moby/template
index 2aa2e426b02597..1cfb875de630a3 100644
--- a/srcpkgs/moby/template
+++ b/srcpkgs/moby/template
@@ -2,7 +2,7 @@
# should be kept in sync with docker-cli
pkgname=moby
version=25.0.3
-revision=1
+revision=2
# libnetwork commit is mentioned in vendor.conf
_libnetwork_commit=05b93e0d3a95952f70c113b0bc5bdb538d7afdd7
create_wrksrc=yes
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (17 preceding siblings ...)
2024-03-11 0:30 ` thetredev
@ 2024-06-09 1:52 ` github-actions
2024-06-11 19:56 ` [PR PATCH] [Updated] " thetredev
` (8 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: github-actions @ 2024-06-09 1:52 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
New comment by github-actions[bot] on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-2156266594
Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR PATCH] [Updated] docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (18 preceding siblings ...)
2024-06-09 1:52 ` github-actions
@ 2024-06-11 19:56 ` thetredev
2024-06-11 19:57 ` thetredev
` (7 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-06-11 19:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3649 bytes --]
There is an updated pull request by thetredev against master on the void-packages repository
https://github.com/thetredev/void-packages docker/fix-wsl-service-startup
https://github.com/void-linux/void-packages/pull/46667
docker: Parameterize loading the loop kernel module
These changes introduce a config variable `LOAD_LOOP_MODULE` which can be set to `yes` (default) or `no` within the `/etc/docker/sv/conf` file.
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
- I tested that the Docker service is working when the `loop` kernel module is not required (e.g. under WSL): **YES** (see below)
```
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
cat: /etc/sv/docker/conf: No such file or directory
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 1s, normally up, want up; run: log: (pid 170) 3s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=yes
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 0s, normally up, want up; run: log: (pid 170) 35s
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=no
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
ok: run: docker: (pid 479) 1s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
run: docker: (pid 479) 2s; run: log: (pid 170) 45s
PS C:\Users\Cheeba> wsl -u root bash -ic "docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\Users\Cheeba> wsl -u root bash -ic "docker version"
Client:
Version: 24.0.6
API version: 1.43
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.7
GitCommit: UNSET
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
PS C:\Users\Cheeba>
```
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both when the `loop` module is available and has to be loaded (default), as well as in systems where it's not available or not required, like WSL2.
A patch file from https://github.com/void-linux/void-packages/pull/46667.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-docker/fix-wsl-service-startup-46667.patch --]
[-- Type: text/x-diff, Size: 1331 bytes --]
From 3a9f9ad373373475bb5acb80dac8598eb82a418d Mon Sep 17 00:00:00 2001
From: Timo Reichl <thetredev@gmail.com>
Date: Sat, 14 Oct 2023 18:11:24 +0200
Subject: [PATCH] docker: Parameterize loading the loop kernel module
Signed-off-by: Timo Reichl <thetredev@gmail.com>
---
srcpkgs/moby/files/docker/run | 5 ++++-
srcpkgs/moby/template | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/moby/files/docker/run b/srcpkgs/moby/files/docker/run
index 959c22b803c587..386830059f7700 100644
--- a/srcpkgs/moby/files/docker/run
+++ b/srcpkgs/moby/files/docker/run
@@ -1,7 +1,10 @@
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
-modprobe -q loop || exit 1
+case "${LOAD_LOOP_MODULE:-yes}" in
+ no) ;;
+ *) modprobe -q loop || exit 1 ;;
+esac
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
diff --git a/srcpkgs/moby/template b/srcpkgs/moby/template
index f583e0d345cc4f..ded0de5b7d38f6 100644
--- a/srcpkgs/moby/template
+++ b/srcpkgs/moby/template
@@ -2,7 +2,7 @@
# should be kept in sync with docker-cli
pkgname=moby
version=26.1.4
-revision=1
+revision=2
# libnetwork commit is mentioned in vendor.conf
_libnetwork_commit=05b93e0d3a95952f70c113b0bc5bdb538d7afdd7
create_wrksrc=yes
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (19 preceding siblings ...)
2024-06-11 19:56 ` [PR PATCH] [Updated] " thetredev
@ 2024-06-11 19:57 ` thetredev
2024-06-16 0:00 ` dannyhpy
` (6 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-06-11 19:57 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 175 bytes --]
New comment by thetredev on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-2161508158
Comment:
bump. Rebased to lastest master
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (20 preceding siblings ...)
2024-06-11 19:57 ` thetredev
@ 2024-06-16 0:00 ` dannyhpy
2024-06-16 3:49 ` thetredev
` (5 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: dannyhpy @ 2024-06-16 0:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 283 bytes --]
New comment by dannyhpy on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-2170979006
Comment:
On Void Linux on WSL 2 (Win. 23H2), `sv up docker` now seems to work just fine without any patch necessary and `modprobe -q loop` also works
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (21 preceding siblings ...)
2024-06-16 0:00 ` dannyhpy
@ 2024-06-16 3:49 ` thetredev
2024-07-20 19:50 ` [PR PATCH] [Updated] " thetredev
` (4 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-06-16 3:49 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
New comment by thetredev on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-2171033883
Comment:
Thanks for the info @dannyhpy, didn't know that. So if the change doesn't affect WSL in any way in Windows 11, we should still include it for Windows 10 I'd say.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR PATCH] [Updated] docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (22 preceding siblings ...)
2024-06-16 3:49 ` thetredev
@ 2024-07-20 19:50 ` thetredev
2024-10-19 1:58 ` github-actions
` (3 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-07-20 19:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3649 bytes --]
There is an updated pull request by thetredev against master on the void-packages repository
https://github.com/thetredev/void-packages docker/fix-wsl-service-startup
https://github.com/void-linux/void-packages/pull/46667
docker: Parameterize loading the loop kernel module
These changes introduce a config variable `LOAD_LOOP_MODULE` which can be set to `yes` (default) or `no` within the `/etc/docker/sv/conf` file.
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
- I tested that the Docker service is working when the `loop` kernel module is not required (e.g. under WSL): **YES** (see below)
```
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
cat: /etc/sv/docker/conf: No such file or directory
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 1s, normally up, want up; run: log: (pid 170) 3s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=yes
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 0s, normally up, want up; run: log: (pid 170) 35s
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=no
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
ok: run: docker: (pid 479) 1s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
run: docker: (pid 479) 2s; run: log: (pid 170) 45s
PS C:\Users\Cheeba> wsl -u root bash -ic "docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\Users\Cheeba> wsl -u root bash -ic "docker version"
Client:
Version: 24.0.6
API version: 1.43
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.7
GitCommit: UNSET
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
PS C:\Users\Cheeba>
```
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both when the `loop` module is available and has to be loaded (default), as well as in systems where it's not available or not required, like WSL2.
A patch file from https://github.com/void-linux/void-packages/pull/46667.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-docker/fix-wsl-service-startup-46667.patch --]
[-- Type: text/x-diff, Size: 1331 bytes --]
From b179d6632338b201ef6cae0445ac3667872439e9 Mon Sep 17 00:00:00 2001
From: Timo Reichl <thetredev@gmail.com>
Date: Sat, 14 Oct 2023 18:11:24 +0200
Subject: [PATCH] docker: Parameterize loading the loop kernel module
Signed-off-by: Timo Reichl <thetredev@gmail.com>
---
srcpkgs/moby/files/docker/run | 5 ++++-
srcpkgs/moby/template | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/moby/files/docker/run b/srcpkgs/moby/files/docker/run
index 959c22b803c587..386830059f7700 100644
--- a/srcpkgs/moby/files/docker/run
+++ b/srcpkgs/moby/files/docker/run
@@ -1,7 +1,10 @@
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
-modprobe -q loop || exit 1
+case "${LOAD_LOOP_MODULE:-yes}" in
+ no) ;;
+ *) modprobe -q loop || exit 1 ;;
+esac
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
diff --git a/srcpkgs/moby/template b/srcpkgs/moby/template
index f583e0d345cc4f..ded0de5b7d38f6 100644
--- a/srcpkgs/moby/template
+++ b/srcpkgs/moby/template
@@ -2,7 +2,7 @@
# should be kept in sync with docker-cli
pkgname=moby
version=26.1.4
-revision=1
+revision=2
# libnetwork commit is mentioned in vendor.conf
_libnetwork_commit=05b93e0d3a95952f70c113b0bc5bdb538d7afdd7
create_wrksrc=yes
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (23 preceding siblings ...)
2024-07-20 19:50 ` [PR PATCH] [Updated] " thetredev
@ 2024-10-19 1:58 ` github-actions
2024-10-26 16:12 ` [PR PATCH] [Updated] " thetredev
` (2 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: github-actions @ 2024-10-19 1:58 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
New comment by github-actions[bot] on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-2423474098
Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR PATCH] [Updated] docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (24 preceding siblings ...)
2024-10-19 1:58 ` github-actions
@ 2024-10-26 16:12 ` thetredev
2024-10-26 16:17 ` [PR PATCH] [Closed]: " thetredev
2024-10-26 16:17 ` thetredev
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-10-26 16:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3649 bytes --]
There is an updated pull request by thetredev against master on the void-packages repository
https://github.com/thetredev/void-packages docker/fix-wsl-service-startup
https://github.com/void-linux/void-packages/pull/46667
docker: Parameterize loading the loop kernel module
These changes introduce a config variable `LOAD_LOOP_MODULE` which can be set to `yes` (default) or `no` within the `/etc/docker/sv/conf` file.
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
- I tested that the Docker service is working when the `loop` kernel module is not required (e.g. under WSL): **YES** (see below)
```
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
cat: /etc/sv/docker/conf: No such file or directory
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 1s, normally up, want up; run: log: (pid 170) 3s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=yes
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 0s, normally up, want up; run: log: (pid 170) 35s
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=no
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
ok: run: docker: (pid 479) 1s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
run: docker: (pid 479) 2s; run: log: (pid 170) 45s
PS C:\Users\Cheeba> wsl -u root bash -ic "docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\Users\Cheeba> wsl -u root bash -ic "docker version"
Client:
Version: 24.0.6
API version: 1.43
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.7
GitCommit: UNSET
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
PS C:\Users\Cheeba>
```
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both when the `loop` module is available and has to be loaded (default), as well as in systems where it's not available or not required, like WSL2.
A patch file from https://github.com/void-linux/void-packages/pull/46667.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-docker/fix-wsl-service-startup-46667.patch --]
[-- Type: text/x-diff, Size: 1331 bytes --]
From 7a1918d230f8eab7cbbaea48afd3174f0cbbc77a Mon Sep 17 00:00:00 2001
From: Timo Reichl <thetredev@gmail.com>
Date: Sat, 14 Oct 2023 18:11:24 +0200
Subject: [PATCH] docker: Parameterize loading the loop kernel module
Signed-off-by: Timo Reichl <thetredev@gmail.com>
---
srcpkgs/moby/files/docker/run | 5 ++++-
srcpkgs/moby/template | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/moby/files/docker/run b/srcpkgs/moby/files/docker/run
index 959c22b803c587..386830059f7700 100644
--- a/srcpkgs/moby/files/docker/run
+++ b/srcpkgs/moby/files/docker/run
@@ -1,7 +1,10 @@
#!/bin/sh
exec 2>&1
[ -r conf ] && . ./conf
-modprobe -q loop || exit 1
+case "${LOAD_LOOP_MODULE:-yes}" in
+ no) ;;
+ *) modprobe -q loop || exit 1 ;;
+esac
mountpoint -q /sys/fs/cgroup/systemd || {
mkdir -p /sys/fs/cgroup/systemd;
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd;
diff --git a/srcpkgs/moby/template b/srcpkgs/moby/template
index fe551feae995aa..7e5ea532ebf854 100644
--- a/srcpkgs/moby/template
+++ b/srcpkgs/moby/template
@@ -2,7 +2,7 @@
# should be kept in sync with docker-cli
pkgname=moby
version=27.3.1
-revision=1
+revision=2
# libnetwork commit is mentioned in vendor.conf
_libnetwork_commit=05b93e0d3a95952f70c113b0bc5bdb538d7afdd7
create_wrksrc=yes
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PR PATCH] [Closed]: docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (25 preceding siblings ...)
2024-10-26 16:12 ` [PR PATCH] [Updated] " thetredev
@ 2024-10-26 16:17 ` thetredev
2024-10-26 16:17 ` thetredev
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-10-26 16:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3466 bytes --]
There's a closed pull request on the void-packages repository
docker: Parameterize loading the loop kernel module
https://github.com/void-linux/void-packages/pull/46667
Description:
These changes introduce a config variable `LOAD_LOOP_MODULE` which can be set to `yes` (default) or `no` within the `/etc/docker/sv/conf` file.
#### Testing the changes
- I tested the changes in this PR: **YES** (`xlint docker` + `./xbps-src pkg -Q docker`)
- I tested that the Docker service is working when the `loop` kernel module is not required (e.g. under WSL): **YES** (see below)
```
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
cat: /etc/sv/docker/conf: No such file or directory
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 1s, normally up, want up; run: log: (pid 170) 3s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=yes
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
timeout: down: docker: 1s, normally up, want up
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
down: docker: 0s, normally up, want up; run: log: (pid 170) 35s
PS C:\Users\Cheeba> wsl -u root bash -ic "vim /etc/sv/docker/conf"
PS C:\Users\Cheeba> wsl -u root bash -ic "cat /etc/sv/docker/conf"
LOAD_LOOP_MODULE=no
PS C:\Users\Cheeba> wsl -u root bash -ic "sv restart docker"
ok: run: docker: (pid 479) 1s
PS C:\Users\Cheeba> wsl -u root bash -ic "sv status docker"
run: docker: (pid 479) 2s; run: log: (pid 170) 45s
PS C:\Users\Cheeba> wsl -u root bash -ic "docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\Users\Cheeba> wsl -u root bash -ic "docker version"
Client:
Version: 24.0.6
API version: 1.43
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.21.0
Git commit: tag v24.0.6
Built: Wed Sep 6 13:42:27 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.7
GitCommit: UNSET
runc:
Version: 1.1.9
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
PS C:\Users\Cheeba>
```
#### Motivation behind the changes
I played around with using Void Linux under WSL2 and struggled to get the Docker service started up. Eventually I realized that the `modprobe -q loop` command would *always* fail under WSL2, because there is no directory `/lib/modules`, so `modprobe` is essentially useless under WSL2. I think there are other mechanisms involved when loading the WSL2 kernel and modules. Either way, Docker runs very well with these changes.
I understand that Void Linux is not officially supported by Microsoft (and probably vice-versa), and there's manual steps involved installing it, but I thought why not make Docker run for everybody nonetheless?
These changes should make the Docker service run both when the `loop` module is available and has to be loaded (default), as well as in systems where it's not available or not required, like WSL2.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: docker: Parameterize loading the loop kernel module
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
` (26 preceding siblings ...)
2024-10-26 16:17 ` [PR PATCH] [Closed]: " thetredev
@ 2024-10-26 16:17 ` thetredev
27 siblings, 0 replies; 29+ messages in thread
From: thetredev @ 2024-10-26 16:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 258 bytes --]
New comment by thetredev on void-packages repository
https://github.com/void-linux/void-packages/pull/46667#issuecomment-2439638274
Comment:
Closing this one. Not sure why the builds won't work but either way I don't have much time for this at the moment.
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2024-10-26 16:17 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-13 21:15 [PR PATCH] docker: Fix service startup under WSL2 thetredev
2023-10-14 7:31 ` classabbyamp
2023-10-14 12:27 ` thetredev
2023-10-14 14:56 ` ahesford
2023-10-14 14:56 ` [PR PATCH] [Closed]: " ahesford
2023-10-14 15:02 ` ahesford
2023-10-14 15:02 ` ahesford
2023-10-14 15:55 ` thetredev
2023-10-14 16:00 ` [PR PATCH] [Updated] " thetredev
2023-10-14 16:08 ` [PR REVIEW] docker: Parameterize loading the loop kernel module ahesford
2023-10-14 16:08 ` thetredev
2023-10-14 16:11 ` [PR PATCH] [Updated] " thetredev
2023-10-14 16:11 ` [PR REVIEW] " thetredev
2023-10-14 16:13 ` thetredev
2023-10-14 16:26 ` thetredev
2024-03-09 22:53 ` [PR PATCH] [Updated] " thetredev
2024-03-09 22:53 ` thetredev
2024-03-11 0:25 ` [PR PATCH] [Updated] " thetredev
2024-03-11 0:30 ` thetredev
2024-06-09 1:52 ` github-actions
2024-06-11 19:56 ` [PR PATCH] [Updated] " thetredev
2024-06-11 19:57 ` thetredev
2024-06-16 0:00 ` dannyhpy
2024-06-16 3:49 ` thetredev
2024-07-20 19:50 ` [PR PATCH] [Updated] " thetredev
2024-10-19 1:58 ` github-actions
2024-10-26 16:12 ` [PR PATCH] [Updated] " thetredev
2024-10-26 16:17 ` [PR PATCH] [Closed]: " thetredev
2024-10-26 16:17 ` thetredev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).