{"id":20641814,"url":"https://github.com/boon-code/docker-inside","last_synced_at":"2025-04-16T01:37:09.514Z","repository":{"id":48444718,"uuid":"115890066","full_name":"boon-code/docker-inside","owner":"boon-code","description":"Allows to run a docker container as current user (similar to Jenkins docker.inside())","archived":false,"fork":false,"pushed_at":"2025-01-27T02:49:13.000Z","size":155,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T06:24:02.282Z","etag":null,"topics":["docker","jenkins"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boon-code.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2017-12-31T23:29:22.000Z","updated_at":"2024-10-07T07:00:59.000Z","dependencies_parsed_at":"2024-03-11T18:53:27.561Z","dependency_job_id":null,"html_url":"https://github.com/boon-code/docker-inside","commit_stats":{"total_commits":126,"total_committers":2,"mean_commits":63.0,"dds":0.007936507936507908,"last_synced_commit":"ae3bdeb4aca350c9e9df4c94835cf1565bee2fce"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boon-code%2Fdocker-inside","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boon-code%2Fdocker-inside/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boon-code%2Fdocker-inside/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boon-code%2Fdocker-inside/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boon-code","download_url":"https://codeload.github.com/boon-code/docker-inside/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182783,"owners_count":21226123,"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":["docker","jenkins"],"created_at":"2024-11-16T16:06:44.565Z","updated_at":"2025-04-16T01:37:09.498Z","avatar_url":"https://github.com/boon-code.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Inside\n\n[![Build Status](https://github.com/boon-code/docker-inside/actions/workflows/python-package-main.yml/badge.svg)](https://github.com/boon-code/docker-inside/actions)\n[![PyPI](https://img.shields.io/pypi/v/docker-inside.svg)](https://pypi.python.org/pypi/docker-inside)\n\n`dockerinside` is a Python (Python3 only) package that shall simplify running docker images as the current user\nsimilar to the way *Jenkins* awesome ``docker.inside()`` works.\nThere are two main use-cases:\n\n- You want to easily share access between a container and your environment without having to\n  manually modify the user id and group id of the files created by the running container.\n- You want to run *dockerized* GUI applications but share your home environment\n\nYou don't have to write a Dockerfile just to adapt to your environment (user id / group id). It is\na much more elegant approach to adapt the environment during startup of the container on the fly as\n*Jenkins* does it.\n\n\n## Installation\n\nPrerequisits:\n\n- Python3 installation (``\u003e= 3.6``)\n- `python3-venv` is recommended to create a virtual environment\n\nInstall current *stable* version (preferably in a virtual environment):\n\n        pip install git+https://github.com/boon-code/docker-inside.git\n\nFor convenience, `dockerinside` uses [su-exec](https://github.com/ncopa/su-exec) which is\nstatically compiled using `alpine` and `musl-c` library. To build it, you have to run\n\n        # use --auto-pull to download alpine image for compilation if it's not available\n        docker-inside-setup --auto-pull\n\nThis will create a directory `~/.config/docker_inside/` and put a file named `su-exec` there. You\ncan also compile `su-exec` and create the file structure yourself or not use it at all. If this\nfile doesn't exist, `su` is used to switch user id which might cause problems with `tty` handling,\nso it's highly recommended to use `su-exec`.\n\n\nBig thanks to **Natanael Copa** (*ncopa*) for sharing `su-exec`.\n\n### NO\\_README\n\nIf you experience problems related to packaging the `README.md` or related to\n`setuptools` you can disable this behavior using the environment variable\n`NO_README` (f.e. `NO_README=1`).\n\n## Usage\n### Basic\nRunning an `ubuntu:16.04` container as current user with the home directory mounted:\n\n        docker-inside -H ubuntu:16.04\n\nwhich is roughly equivalent to running\n\n        docker run --rm -ti --user \"$(id -u)\" -v \"${HOME}:${HOME}\" ubuntu:16.04\n\nbut does already add users and groups so you won't see `I have no name!` in your shell prompt.\n\n### Fake Home\nYou can also use a *fake* home directory\n\n        mkdir -p /tmp/fake-home\n        docker-inside --mount-as-home /tmp/fake-home ubuntu:16.04 -- echo \"Hello, World\" \\\u003e~/readme.txt\n        #DockerInside : MainThread : INFO : Starting container: 59133ebeb3a3116999f66b4e302ba675a74f02ac83ae526704f2f4cdbd82ed5d\n        #DockerInside : MainThread : INFO : Container 59133ebeb3a3116999f66b4e302ba675a74f02ac83ae526704f2f4cdbd82ed5d stopped\n        cat /tmp/fake-home/readme.txt\n        #Hello, World\n\n### Jenkins Debugging\nSometimes, I just quickly want to debug a problem on a failing *Jenkins* job which uses docker with\nlot's of bind mounts which is as simple as this:\n\n        cd \u003cWORKSPACE\u003e\n        docker-inside -v \u003cfirst-mount\u003e:\u003csome-path\u003e \\\n                      -v \u003csecond-mount\u003e:\u003csome-other-path\u003e \\\n                      -v \u003cWORKSPACE\u003e \\\n                      -w \u003cWORKSPACE\u003e \\\n                      \u003cIMAGE_TO_USE\u003e \\\n                      [optional-command]\n\n### Additional Use-Cases\n\nPlease let me know I you need support for more options from original `docker run` command or have\nany other suggestions how to improve this package.\nPlease also let me know if your Docker image is failing using this package and I will see if I can\nfix the issue. Adding users and groups is unfortunately quite different among distributions.\n\n## Related\n\nI still use the package myself on a regular basis when using Docker. However, to avoid having to\nrely on work-arounds used in this script, `podman` is a simple and powerful replacement for Docker.\n`podman` handles user permissions and bind mounts in a sane way per default. Check it out!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboon-code%2Fdocker-inside","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboon-code%2Fdocker-inside","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboon-code%2Fdocker-inside/lists"}