Skip to content

A simple Bash script to `chroot` in any Linux distribution

License

Notifications You must be signed in to change notification settings

davlgd/chroot-from-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chroot from image

This repository contains a simple Bash script to chroot in any Linux distribution. Its filesystem is extracted from a docker image and then mounted. You can learn more in my dedicated blog post.

Usage

./chroot-from-image <image> <command>

Example

./chroot_from_image centos
./chroot_from_image ubuntu:20.04
./chroot_from_image alpine /bin/sh
./chroot_from_image exherbo/exherbo-x86_64-pc-linux-gnu-gcc-base

This also works with Podman and alternative hubs, if configured to be used from the docker command.

Unmounting and cleaning

Mounted directories and exported container are automatically cleaned up when you exit the chroot environment. If you need to clean up manually, there is the clean_image script.

Usage

./clean_image <image>

Example

./clean_image centos
./clean_image ubuntu:20.04
./clean_image alpine
./clean_image exherbo/exherbo-x86_64-pc-linux-gnu-gcc-base

License

This project is under the MIT License.


[]: # Path: LICENSE

About

A simple Bash script to `chroot` in any Linux distribution

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages