Skip to content

nsenter on Alpine 3.6 won't enter namespaces for a specified PID #359

@JakeWarner

Description

@JakeWarner

Steps to reproduce:

  1. Start container with Alpine 3.6
  2. Start a container within that container.
  3. "nsenter -p -i -u -m -n -t CONTAINER_PID /bin/sh"

Expected result:
A new /bin/sh session inside of container pid.

Actual result:
nsenter shows the help display again without an error.

Command I ran:

/ # nsenter -m -u -i -n -p -t 46 /bin/sh
BusyBox v1.26.2 (2017-10-04 13:37:41 GMT) multi-call binary.

Usage: nsenter [OPTIONS] [PROG [ARGS]]

	-t, --target=PID		Target process to get namespaces from
	-m, --mount[=FILE]		Enter mount namespace
	-u, --uts[=FILE]		Enter UTS namespace (hostname etc)
	-i, --ipc[=FILE]		Enter System V IPC namespace
	-n, --net[=FILE]		Enter network namespace
	-p, --pid[=FILE]		Enter pid namespace
	-U, --user[=FILE]		Enter user namespace
	-S, --setuid=UID		Set uid in entered namespace
	-G, --setgid=GID		Set gid in entered namespace
	--preserve-credentials		Don't touch uids or gids
	-r, --root[=DIR]		Set root directory
	-w, --wd[=DIR]			Set working directory
	-F, --no-fork			Don't fork before exec'ing PROG

Changing the order, omitting, or even specifying the direct paths to the namespaces doesn't yield a different result.

If I run "apk add --update util-linux" then try to run the above command, I get:
.: applet not found

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions