Skip to content

Commit a3aee7c

Browse files
committed
Add rdd-guest socket bridge for Windows Docker socket forwarding
Build rdd-guest from rancher-desktop-daemon's cmd/rdd-guest and include it in the VM image. Add a systemd unit that starts it on WSL2 instances as part of rancher-desktop.target. Signed-off-by: Nino Kodabande <nkodabande@suse.com>
1 parent 5a997bc commit a3aee7c

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/g
1212
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod \
1313
go build -ldflags '-s -w' -o /go/bin/rancher-desktop-guest-agent ./src/go/guestagent
1414

15+
RUN git clone https://github.com/rancher-sandbox/rancher-desktop-daemon --depth=1 /daemon
16+
WORKDIR /daemon
17+
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod \
18+
CGO_ENABLED=0 go build -ldflags '-s -w' -o /go/bin/rdd-guest ./cmd/rdd-guest
19+
1520
COPY src /rd
1621
WORKDIR /rd/rd-init
1722
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod \

config.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ if [[ ${kiwi_profiles:-} =~ wsl ]]; then
117117
systemctl enable network-setup
118118
systemctl enable rancher-desktop-guest-agent.service
119119
systemctl enable wsl-proxy.service
120+
systemctl enable rdd-guest.service
120121
# Do not manage /tmp; that is managed by WSL.
121122
mkdir -p /usr/local/lib/tmpfiles.d
122123
touch /usr/local/lib/tmpfiles.d/fs-tmp.conf
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=Rancher Desktop Guest Socket Bridge
3+
Documentation=https://github.com/rancher-sandbox/rancher-desktop-daemon
4+
ConditionVirtualization=wsl
5+
6+
[Service]
7+
ExecStart=/usr/local/bin/rdd-guest
8+
Restart=on-failure
9+
RestartSec=5s
10+
StandardOutput=journal
11+
StandardError=journal
12+
13+
[Install]
14+
WantedBy=rancher-desktop.target

0 commit comments

Comments
 (0)