{"id":22367669,"url":"https://github.com/hugojosefson/isolate-in-docker","last_synced_at":"2026-04-10T00:36:29.039Z","repository":{"id":66830214,"uuid":"163527058","full_name":"hugojosefson/isolate-in-docker","owner":"hugojosefson","description":"Wrapper script for running different developer tools in isolation, where they only have access to current directory.","archived":false,"fork":false,"pushed_at":"2022-08-12T21:25:12.000Z","size":100,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T17:48:14.384Z","etag":null,"topics":["aws","aws-cli","cli","docker","hacktoberfest","heroku","heroku-cli","node","nodejs","npm","npx","webstorm","wrapper","yarn"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hugojosefson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-12-29T17:00:41.000Z","updated_at":"2021-11-21T05:46:31.000Z","dependencies_parsed_at":"2023-02-21T05:45:23.182Z","dependency_job_id":null,"html_url":"https://github.com/hugojosefson/isolate-in-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugojosefson%2Fisolate-in-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugojosefson%2Fisolate-in-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugojosefson%2Fisolate-in-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugojosefson%2Fisolate-in-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugojosefson","download_url":"https://codeload.github.com/hugojosefson/isolate-in-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245689481,"owners_count":20656416,"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":["aws","aws-cli","cli","docker","hacktoberfest","heroku","heroku-cli","node","nodejs","npm","npx","webstorm","wrapper","yarn"],"created_at":"2024-12-04T18:19:58.713Z","updated_at":"2025-12-30T20:32:57.535Z","avatar_url":"https://github.com/hugojosefson.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# isolate-in-docker\n\nWrapper script for running Node.js, Heroku CLI, AWS CLI, WebStorm or GoLand in\nisolation, where they only have access to current directory.\n\nLets you keep those tools uninstalled in your main environment, to limit your\nexposure to any malware that may be hosted on for example `npmjs.com`.\n\n## Install\n\n### Prerequisites\n\nFirst, make sure you don't have any Node.js or Heroku CLI installation\nleft. Each of these commands *should find nothing*:\n\n```bash\nwhich node\nwhich npm\nwhich npx\nwhich yarn\nwhich heroku\nwhich webstorm\nwhich goland\nwhich clion\nwhich aws\n```\n\nIf they find any executable(s), uninstall them and try again.\n\n### Actual installation\n\n```bash\n( \\\n   cd /usr/local/bin \\\n\u0026\u0026 curl https://raw.githubusercontent.com/hugojosefson/isolate-in-docker/master/isolate-in-docker -o isolate-in-docker \\\n\u0026\u0026 chmod +x isolate-in-docker \\\n\u0026\u0026 ln -s isolate-in-docker node \\\n\u0026\u0026 ln -s isolate-in-docker npm \\\n\u0026\u0026 ln -s isolate-in-docker npx \\\n\u0026\u0026 ln -s isolate-in-docker yarn \\\n\u0026\u0026 ln -s isolate-in-docker heroku \\\n\u0026\u0026 ln -s isolate-in-docker webstorm \\\n\u0026\u0026 ln -s isolate-in-docker webstorm-install-rust \\\n\u0026\u0026 ln -s isolate-in-docker goland \\\n\u0026\u0026 ln -s isolate-in-docker cion \\\n\u0026\u0026 ln -s isolate-in-docker aws \\\n)\n```\n\n## Usage\n\nUse just like regular `node`, `npm` etc.\n\n```bash\nnode --version\nnpm init\nyarn add express mocha\nnpm test\nnpx cowsay It works!\n\nheroku --help\n\nwebstorm .\n\naws --version\n```\n\nNote that only the current directory where you call the script from, is\navailable inside the docker instance. See `DOCKER_WORKDIR` below.\n\n### Configuration options\n\nOptions are configured with environment variables.\n\n*(Table via\n[tablesgenerator.com](https://www.tablesgenerator.com/markdown_tables))*\n\n| Environment variable | Specifies                                                                                                                                                                                                         | Default value                                                                | Example values                                                                                              | Valid values                                          |\n|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|\n| `NODE_VERSION`       | Version of Node.js to use.                                                                                                                                                                                        | `lts`                                                                        | `8`, `10.2.2`, `stable`                                                                                     | Tags from https://hub.docker.com/_/node               |\n| `PORT`               | Port number to pass through to the container's environment.                                                                                                                                   | `\"\"`                                                                         | `8000`, `1234`                                                                                              | Any port number.                                      |\n| `DOCKER_IMAGE`       | Docker image to use.                                                                                                                                                                                              | `node:$NODE_VERSION`                                                         | `my-special-node:latest`                                                                                    | Any valid Docker image reference.                     |\n| `DOCKER_USER`        | User, or `user:group` to become inside the container.                                                                                                                                                             | Current user and group: `$(id -u):$(id -g)`                                  | `root`, `1000`, `1000:1000`                                                                                 | https://docs.docker.com/engine/reference/run/#user    |\n| `DOCKER_WORKDIR`     | Where to execute the command inside the container. ***NOTE: Directory is shared with the container.***                                                                                                            | Current directory: `$(pwd)`                                                  | `..`, `/tmp/somedir`                                                                                        | https://docs.docker.com/engine/reference/run/#workdir |\n| `DOCKER_EXTRA_ARGS`  | Any extra arguments to `docker run`.                                                                                                                                                                              | `\"\"`                                                                         | `\"--volume /opt/extralibs:/opt/extralibs\"`,  `\"--volume /opt/extralibs:/opt/extralibs --publish 8001:8001\"` | https://docs.docker.com/engine/reference/run/         |\n| `DOCKER_CMD`         | The `CMD` to run inside the container: `node`, `npm` etc.                                                                                                                                                         | Name of the symlink pointing to this script: `$(basename \"${0}\")`            | `bash`                                                                                                      | Any valid executable inside the Docker container.     |\n| `CACHE_DIR`          | Directory on the host to hold the container's `$HOME` directory, which includes any cached `.npm/`, `.npmrc`, from previous executions with the same `DOCKER_WORKDIR`. May any include login information for NPM. | Unique directory per workdir located in `${HOME}/.cache/isolate-in-docker}`. | `/var/cache/common-npm-cache`                                                                               | Any directory on the host.                            |\n| `CONFIG_DIR`         | Directory on the host to hold the container's config files.                                                                                                                                                       | Unique directory per workdir located in `${HOME}/.config/isolate-in-docker}` | `/etc/isolate-in-docker`                                                                                    | Any directory on the host.                            |\n\n### Examples\n\nSome examples using the environment variables for configuration:\n\n```bash\n# Start the current project passing `PORT=3000` to the app:\nPORT=3000 npm start\n\n# Same, using Node.js version 8:\nPORT=3000 NODE_VERSION=8 npm start\n\n# Serve the current directory on port 3000:\nPORT=3000 npx serve\n\n```\n\n### Config files (`*.rc`) in `CONFIG_DIR`\n\nYou may place configuration files in `CONFIG_DIR` to specify defaults\nfor any environment variables. They will be sourced before evaluating\nthe environment.\n\nConfiguration files are named as the executable they will be loaded\nwith, suffixed by `.rc`. For example, to add default config for `npx`,\ncreate a file `${CONFIG_DIR}/npx.rc` with for example this content:\n\n```bash\nNODE_VERSION=10\nDOCKER_WORKDIR=/tmp/npx-workdir\n```\n\nDefault file loaded first for all commands, is\n`${CONFIG_DIR}/default.rc`.\n\n*TIP: The `CONFIG_DIR` for the current working directory will be created\non the first execution of either command. Run for example `node\n--version` to get the `CONFIG_DIR` created for you.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugojosefson%2Fisolate-in-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugojosefson%2Fisolate-in-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugojosefson%2Fisolate-in-docker/lists"}