Skip to content

Commit

Permalink
devcontainer: VSC_DEBASE: Fix 'server'for host using cgroups v2
Browse files Browse the repository at this point in the history
  • Loading branch information
NGenetzky committed Jan 28, 2024
1 parent 9ff355d commit 178674e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .devcontainer/script/server
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ D_TOP="${D_SCRIPT}/../../"
cd "${D_TOP}"

set -eu
set -x
# set -x

NAME="$(basename "$(pwd)")"
NAME_CONTAINER="${NAME}"
Expand All @@ -22,15 +22,14 @@ docker rm "${NAME_CONTAINER}" || true

# WARN: VSC_DEBASE requires different usage for host using cgroups v1 vs v2.
# -v '/sys/fs/cgroup:/sys/fs/cgroup:ro' # NOTE: Use if host cgroup v1
# exec docker run -td --rm \
# --stop-signal=SIGRTMIN+3 \
# --tmpfs /run:size=100M \
# --tmpfs /run/lock:size=100M \
# -v '/sys/fs/cgroup:/sys/fs/cgroup:ro' \
# -e DEBBASE_SSH='enabled' \
# -p '127.0.0.1:1022:22' \
# --name="${NAME}" \
# "${NAME_IMAGE}"
exec docker run -td --rm \
--stop-signal=SIGRTMIN+3 \
--tmpfs /run:size=100M --tmpfs /run/lock:size=100M \
-v '/sys/fs/cgroup:/sys/fs/cgroup:rw' --cgroupns=host \
-e DEBBASE_SSH='enabled' \
-p '127.0.0.1:1022:22' \
--name="${NAME}" \
"${NAME_IMAGE}"

exit 0

Expand All @@ -39,7 +38,7 @@ exit 0
#"--stop-signal=SIGRTMIN+3", // VSC_DEBASE
#"--tmpfs", "/run:size=100M", // VSC_DEBASE
#"--tmpfs", "/run/lock:size=100M", // VSC_DEBASE
#"-v", "/sys/fs/cgroup:/sys/fs/cgroup:ro", // VSC_DEBASE
# "-v", "/sys/fs/cgroup:/sys/fs/cgroup:ro", // VSC_DEBASE // NOTE: Use if host cgroup v1
# "-v", "/sys/fs/cgroup:/sys/fs/cgroup:rw", "--cgroupns=host", // VSC_DEBASE // NOTE: Use if host cgroup v2
# "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" // VSC_CPP
# "--name=vsc-home", // VSC_DEBASE

0 comments on commit 178674e

Please sign in to comment.