3 ms·
Show HN: container-shell – containers as chroot on steroids
- jbverschoor 3y agoI made this small utility to scratch my own itch. It gives you a shell in a container with the current working directory bind-mounted. This is essentially a chroot on a fresh container. I use it for: 1) development 2) to run linux-only apps not available on homebrew 3) to run (semi) untrusted apps on a directory as I cannot always verify all dependencies etc. 4) throw away debian instances It starts a container and attaches an interactive shell to it. Any subsequent shell invocations will reuse that container (container id is stored in a file in the current dir) You don't have to start / stop or do any other container management. It automatically stops the container when there are no interactive shells anymore. It does so by running the container using a keep-alive loop which checks the number of pseudo terminals. A nifty feature is that it will change the terminal background color while you're inside the container. Feedback is appreciated!