Skip to content

brackendawson/setns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bash Setns

Take bash on tour with builtin setns.

Build it

You need the bash-builtin headers.

$ make

Install it

Load it into bash either once or in your .bashrc:

$ enable -f ./setns.so setns

Use it

For example, you can take your Ubuntu's bash into an Alpine container's filesystem (as root):

# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"

# setns /proc/<alpine-container-pid>/ns/mnt 

# cat /etc/alpine-release 
3.13.1

Why?

With appropriate other bash builtins (like ls and cat), you can now browse inside a container that's FROM scratch.

About

Loadable builtin setns for bash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published