{"id":13563524,"url":"https://github.com/vweevers/node-docker-share","last_synced_at":"2025-04-30T06:45:24.138Z","repository":{"id":57214017,"uuid":"63412623","full_name":"vweevers/node-docker-share","owner":"vweevers","description":"Share local folders with a Docker Machine VM","archived":false,"fork":false,"pushed_at":"2019-11-02T21:07:36.000Z","size":11,"stargazers_count":31,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T06:45:13.283Z","etag":null,"topics":["docker","docker-compose","docker-machine","mount","nodejs","vm"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/vweevers.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-15T10:09:07.000Z","updated_at":"2025-03-19T01:01:33.000Z","dependencies_parsed_at":"2022-08-26T12:33:12.583Z","dependency_job_id":null,"html_url":"https://github.com/vweevers/node-docker-share","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fnode-docker-share","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fnode-docker-share/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fnode-docker-share/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fnode-docker-share/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vweevers","download_url":"https://codeload.github.com/vweevers/node-docker-share/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251658196,"owners_count":21622819,"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","docker-compose","docker-machine","mount","nodejs","vm"],"created_at":"2024-08-01T13:01:20.253Z","updated_at":"2025-04-30T06:45:24.113Z","avatar_url":"https://github.com/vweevers.png","language":"JavaScript","readme":"# docker-share\r\n\r\n**Share local folders with a Docker Machine VM. Currently only capable of adding and mounting transient shares on a running VM.**\r\n\r\n[![node](https://img.shields.io/node/v/docker-share.svg)](https://www.npmjs.org/package/docker-share)\r\n[![npm status](http://img.shields.io/npm/v/docker-share.svg)](https://www.npmjs.org/package/docker-share)\r\n[![Dependency status](https://img.shields.io/david/vweevers/node-docker-share.svg)](https://david-dm.org/vweevers/node-docker-share)\r\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\r\n\r\n## Motivation\r\n\r\nOn Windows with Docker Toolbox, one [can't mount data volumes outside of `C:\\Users`](https://github.com/docker/compose/issues/2548). This makes the use of Docker Compose and relative data volumes (`.:/code`) rather problematic. As a remedy (when migrating to [Windows 10 with Docker for Windows Beta](https://github.com/docker/compose/issues/2548#issuecomment-232415158) is not an option) we can add a project's directory as a VirtualBox shared folder. Then mount it inside the Docker Machine VM - at the exact same path as on the Windows box so that relative volumes resolve correctly. This tool does this for you (and more, like checking if the share already exists). Its main functionality is roughly equivalent to:\r\n\r\n```batch\r\ncd C:\\projects\\my-project\r\n\r\nvboxmanage sharedfolder add default ^\r\n  --name my-project --hostpath \"%cd%\" ^\r\n  --transient\r\n\r\ndocker-machine ssh default sudo ^\r\n  mkdir -p /c/projects/my-project\r\n\r\ndocker-machine ssh default sudo ^\r\n  mount -t vboxsf -o ^\r\n  defaults,uid=`id -u docker`,gid=`id -g docker` ^\r\n  my-project /c/projects/my-project\r\n```\r\n\r\nThis tool should work on other platforms too. If you've found a use for it, let me know! Or just do a little dance.\r\n\r\n## Example\r\n\r\nThese commands should be run after `docker-machine start`, but before `docker run` or `docker-compose up`. Mount the current working directory:\r\n\r\n```\r\ndocker-share mount --transient\r\n```\r\n\r\nMount the current working directory, transient and read-only, at `/home/docker/beep` on a non-default Docker Machine:\r\n\r\n```   \r\ndocker-share mount -m my-machine -tr . /home/docker/beep\r\n```\r\n\r\n## Roadmap\r\n\r\n- [x] Mount transient share\r\n- [ ] Mount permanent share (check state, stop VM if `--force`, edit boot script, restart)\r\n- [ ] Unmount\r\n\r\n## Usage\r\n\r\n### `docker-share \u003ccommand\u003e [options]`\r\n\r\n```\r\nCommands:\r\n  mount    Create shared folder and mount it\r\n  unmount  Unmount and remove shared folder if it exists\r\n\r\nGlobal options:\r\n  --machine, -m  Machine name (DOCKER_MACHINE_NAME or \"default\")  [string]\r\n  --verbose      Verbose output                                  [boolean]\r\n\r\nRun 'docker-share \u003ccommand\u003e --help' for more information on a command.\r\n```\r\n\r\n#### `mount [local path] [guest path]`\r\n\r\nCreates a VirtualBox shared folder and mounts it inside the VM. Without arguments, the local and guest path default to the current working directory. A guest path like `C:\\project` is converted to a cygwin-style `/c/project`.\r\n\r\n```\r\nOptions:\r\n  --name, -n       Shared folder name (basename of local path)  [string]\r\n  --readonly, -r   Create read-only shared folder              [boolean]\r\n  --transient, -t  Create temporary shared folder              [boolean]\r\n  --help           Show help                                   [boolean]\r\n```\r\n\r\n## Install\r\n\r\nWith [npm](https://npmjs.org) do:\r\n\r\n```\r\nnpm install docker-share --global\r\n```\r\n\r\n## License\r\n\r\n[MIT](LICENSE) © 2016-present Vincent Weevers\r\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fnode-docker-share","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvweevers%2Fnode-docker-share","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fnode-docker-share/lists"}