Skip to content

Commit

Permalink
devcontainer.json: use slirp4netns to boot offline (#109)
Browse files Browse the repository at this point in the history
replaces the default (pasta) with slirp4netns in the podman container.

This is a workaround to allow using the container when offline.

Note that this actually degrades network peformance for the container,
so it should be removed once the fix for pasta/podman is eventually
implemented.
See: containers/podman#23566

Note that this requires the host system to have slirp4netns installed
on fedora you can do this via `dnf install slirp4netns`
  • Loading branch information
Adjective-Object authored Dec 11, 2024
1 parent 956ec8b commit d7d3c08
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .devcontainer/podman/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@
// these labels are required in order to allow the container user
// to access the various container mounts.
"--userns=keep-id",
"--security-opt=label=disable"
"--security-opt=label=disable",
// This is a workaround to allow using the container when
// offline.
//
// Note that this actually degrades network peformance for the container,
// so it should be removed once the fix for pasta/podman is eventually
// implemented.
// See: https://github.com/containers/podman/issues/23566
//
// Note that this requires the host system to have slirp4netns installed
// on fedora you can do this via `dnf install slirp4netns`
"--network=slirp4netns"
]
}
3 changes: 2 additions & 1 deletion .devcontainer/podman/patch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"build.dockerfile": "../default/container/Dockerfile",
"runArgs": [
"--userns=keep-id",
"--security-opt=label=disable"
"--security-opt=label=disable",
"--network=slirp4netns"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "devcontainer.json: use slirp4netns to boot offline",
"packageName": "@good-fences/api",
"email": "mhuan13@gmail.com",
"dependentChangeType": "none"
}

0 comments on commit d7d3c08

Please sign in to comment.