{"id":16506947,"url":"https://github.com/JuliaContainerization/Sandbox.jl","last_synced_at":"2025-10-28T01:30:43.276Z","repository":{"id":39970809,"uuid":"330934479","full_name":"JuliaContainerization/Sandbox.jl","owner":"JuliaContainerization","description":"The cultured host's toolkit for ill-mannered Linux guests.","archived":false,"fork":false,"pushed_at":"2025-01-29T16:09:48.000Z","size":490,"stargazers_count":35,"open_issues_count":10,"forks_count":5,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-02-04T18:59:19.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaContainerization.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-19T09:55:19.000Z","updated_at":"2025-01-29T15:37:22.000Z","dependencies_parsed_at":"2023-09-26T22:09:44.174Z","dependency_job_id":"43eaa01d-b08b-414d-87ad-1584fece5219","html_url":"https://github.com/JuliaContainerization/Sandbox.jl","commit_stats":{"total_commits":130,"total_committers":7,"mean_commits":"18.571428571428573","dds":"0.43846153846153846","last_synced_commit":"02edd8ac6b3a9ecd8463f294fbb197e717268bd2"},"previous_names":["juliacontainerization/sandbox.jl"],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaContainerization%2FSandbox.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaContainerization%2FSandbox.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaContainerization%2FSandbox.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaContainerization%2FSandbox.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaContainerization","download_url":"https://codeload.github.com/JuliaContainerization/Sandbox.jl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238579177,"owners_count":19495510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T15:25:47.768Z","updated_at":"2025-10-28T01:30:42.879Z","avatar_url":"https://github.com/JuliaContainerization.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sandbox.jl\n\n[![Stable][docs-stable-img]][docs-stable-url]\n[![Dev][docs-dev-img]][docs-dev-url]\n[![Build Status][ci-img]][ci-url]\n[![Coverage][codecov-img]][codecov-url]\n\n[docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg\n[docs-stable-url]: https://juliacontainerization.github.io/Sandbox.jl/stable\n[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg\n[docs-dev-url]: https://juliacontainerization.github.io/Sandbox.jl/dev\n[ci-img]: https://github.com/JuliaContainerization/Sandbox.jl/workflows/CI/badge.svg\n[ci-url]: https://github.com/JuliaContainerization/Sandbox.jl/actions/workflows/ci.yml\n[codecov-img]: https://codecov.io/gh/JuliaContainerization/Sandbox.jl/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/JuliaContainerization/Sandbox.jl\n\n\u003e The cultured host's toolkit for ill-mannered Linux guests.\n\nThis package provides basic containerization tools for running Linux guests on a variety of platforms.\nAs of the time of writing, it supports two execution backends:\n\n* A Linux User Namespaces executor, which is very fast and lightweight\n\n* A [Docker](https://www.docker.com/) (or [Podman](https://podman.io/)) executor which is slower, but more compatible (it works on macOS, and may work on Windows)\n\nThe executors are responsible for running/virtualizing a given `Cmd` within a root filesystem that is defined by the user, along with various paths that can be mounted within the sandbox.\nThese capabilities were originally built for [BinaryBuilder.jl](https://github.com/JuliaPackaging/BinaryBuilder.jl), however this functionality is now mature enough that it may be useful elsewhere.\n\n## Basic usage\n\nTo make use of this toolkit, you will need to have a root filesystem image that you want to use.\nThis package can download a minimal Debian rootfs that can be used for quick tests; to launch `/bin/bash` in an interactive shell run the following:\n\n```julia\nusing Sandbox\n\nconfig = SandboxConfig(\n    Dict(\"/\" =\u003e Sandbox.debian_rootfs());\n    stdin, stdout, stderr,\n)\nwith_executor() do exe\n    run(exe, config, `/bin/bash -l`)\nend\n```\n\nWhile this launches an interactive session due to hooking up `stdout`/`stdin`, one can easily capture output by setting `stdout` to an `IOBuffer`, or even a `PipeBuffer` to chain together multiple processes from different sandboxes.\n\n## Getting more rootfs images\n\nTo use more interesting rootfs images, you can either create your own using tools such as [`debootstrap`](https://wiki.debian.org/Debootstrap) or you can pull one from docker by using the `pull_docker_image()` function defined within this package.  See the [`contrib`](contrib/) directory for examples of both.\n\nYou can also check out the latest releases of the [`JuliaCI/rootfs-images` repository](https://github.com/JuliaCI/rootfs-images/), which curates a collection of rootfs images for use in CI workloads.\n\n## Multiarch usage\n\nSandbox contains facilities for automatically registering `qemu-user-static` interpreters with `binfmt_misc` to support running on multiple architectures.\nAs of the time of this writing, this is only supported on when running on a Linux host with the `x86_64`, `aarch64` or `powerpc64le` host architectures.\nThe target architectures supported are `x86_64`, `i686`, `aarch64`, `armv7l` and `powerpc64le`.\nNote that while `qemu-user-static` is a marvel of modern engineering, it does still impose some performance penalties, and there may be occasional bugs that break emulation faithfulness.\n\nFor example, to run an aarch64 (ARM v8):\n\n```julia\nusing Base.BinaryPlatforms, Sandbox\n\n# We'll run for this platform\naarch64 = Platform(\"aarch64\", \"linux\")\n\nconfig = SandboxConfig(\n    # Map in a rootfs mounted at `/` that is Debian\n    Dict(\"/\" =\u003e Sandbox.debian_rootfs(;platform=aarch64));\n    # Run using qemu-user-static/binfmt-misc\n    multiarch=[aarch64],\n\n    # Hook up stdout/stderr/stdin so we can be interactive\n    stdout, stderr, stdin,\n\n    # This works around some problems with cross-device links\n    # when installing things via `apt`\n    persist=true\n)\n\nwith_executor() do exe\n    run(exe, config, `/bin/bash -l`)\nend\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuliaContainerization%2FSandbox.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJuliaContainerization%2FSandbox.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuliaContainerization%2FSandbox.jl/lists"}