Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] docker: Fix service startup under WSL2
@ 2023-10-13 21:15 thetredev
  2023-10-14  7:31 ` classabbyamp
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ 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] 19+ messages in thread

end of thread, other threads:[~2024-03-11  0:30 UTC | newest]

Thread overview: 19+ 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

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).