Giter Site home page Giter Site logo

weakbox's Introduction

weakbox

weakbox is a tool for Linux designed to create a weak (not secured) container for running programs from another Linux distribution. It is particularly useful for executing glibc-based programs (mostly closed-source software) under systems that are musl-based.

Features

  • Create a container environment for running programs from different Linux distributions.
  • Bind mount directories from the host system into the container.
  • Map user and group IDs inside the container.
  • Customizable root path for the container.
  • Option to run commands within the container as root.

Installation

To install weakbox, simply clone the repository and compile the source code:

git clone https://github.com/friedelschoen/weakbox.git
cd weakbox
make
sudo make install # which installs /usr/bin/weakbox and /usr/share/man/man1/weakbox.1
sudo make PREFIX=... install # which installs $PREFIX/bin/weakbox and $PREFIX/share/man/man1/weakbox.1

Usage

Run weakbox with the desired options and command to execute within the container:

weakbox [options] command ...

By default command is executed, if command is omitted current shell or /bin/bash is executed.

Options

  • -h: Display usage information.
  • -s: Run the specified command within the container as root.
  • -v: Enable verbose mode for debugging purposes.
  • -r path: Set the root path of the container to path. By default the container lays at $WEAKBOX.
  • -b source[:target]: Bind mount the specified source directory to the target directory within the container. Target is relative to root.
  • -B source: Remove a default bind mount from the container.
  • -u uid[:uid]: Map user IDs inside the container.
  • -g gid[:gid]: Map group IDs inside the container.

Default Mounts

  • /dev: directory containing all devices
  • /home: home directories of users
  • /proc: directories containing information about processes
  • /sys: system directories for various devices
  • /tmp: temporary directory
  • /run: temporary directory for daemons and long-running programs
  • /etc/resolv.conf: nameserver-resolution configuration
  • /etc/passwd: file containing information about users
  • /etc/group: file containing information about groups

Examples

  1. Run a program within the container:
weakbox -s /path/to/program
  1. Create a container with custom root path and bind mount directories:
weakbox -r /custom/root -b /host/dir:/dir /path/to/program
  1. Map user and group IDs inside the container:
weakbox -u 1000:1000 -g 1000:1000 /path/to/program

Contributing

Contributions are welcome! Feel free to submit bug reports, feature requests, or pull requests through GitHub issues and pull requests.

License

This project is licensed under the zlib-license. See the LICENSE file for details.

weakbox's People

Contributors

friedelschoen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.