https://github.com/hankei6km/xros-over-sshfs
Docker container that mount other containers file system automatically
https://github.com/hankei6km/xros-over-sshfs
autofs docker docker-container docker-image fuse mount sshfs
Last synced: about 1 month ago
JSON representation
Docker container that mount other containers file system automatically
- Host: GitHub
- URL: https://github.com/hankei6km/xros-over-sshfs
- Owner: hankei6km
- License: mit
- Created: 2018-01-31T14:56:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-31T16:33:50.000Z (over 8 years ago)
- Last Synced: 2025-01-19T18:37:41.914Z (over 1 year ago)
- Topics: autofs, docker, docker-container, docker-image, fuse, mount, sshfs
- Language: Shell
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# xros-over-sshfs
By run xros-over-sshfs and mount it's `/containers` via sshfs on docker host,
You will be able to access running docker containers files easily.
Run new containers and access their files:
```bash
# run xrso-over-sshfs
$ cd xros-over-sshfs
$ docker-compose up
# to access containers file via `xros-over-sshfs:/containers`
$ sshfs root@172.18.0.2:/containers /path/to/containers
$ sudo docker run --rm -it -d --name hal9000 alpine
$ cat /path/to/containers/hal9000/etc/os-release
$ sudo docker run --rm -it -d --name sal9000 debian
$ cat /path/to/containers/sal9000/etc/os-release
```
## Usage
```YAML
version: '2'
services:
xros-over:
image: hankei6km/xros-over-sshfs:latest
hostname: xros-over
container_name: xros-over
tty: false
privileged: true
command: ["bash", "/tmp/start.sh"]
# uncomment to customize by environment vars.
# environment:
# - ROOTPW=
# - BUMP_AT_CONTAINER_AWAKENS=0
# - AUTOFS_TIMEOUT=300
volumes:
- /var/run/docker.sock:/var/run/docker.sock
```
## Customize
Effective environment variables.
* `ROOTPW`: root password
* `BUMP_AT_CONTAINER_AWAKENS`: `0`(default) - Mount container at to access to container's files. `1` - Mount automatically at the container wakens(`run` `start` etc.).
* `AUTOFS_TIMEOUT`: set timeout to autofs.
## Security
It will be possible to access each running containers files and docker host connected, be careful at launch xros-over-sshfs.
## SSH host keys
No SSH host keys was included on xros-over-sshfs image.
SSH host keys are generated at launch xros-over-sshfs container.
## License
Copyright (c) 2018 hankei6km
Licensed under the MIT License. See LICENSE.txt in the project root.