https://github.com/mvertes/dosu
Switch user then execute a command
https://github.com/mvertes/dosu
Last synced: 9 months ago
JSON representation
Switch user then execute a command
- Host: GitHub
- URL: https://github.com/mvertes/dosu
- Owner: mvertes
- License: isc
- Created: 2016-03-16T23:01:17.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-27T11:21:08.000Z (almost 10 years ago)
- Last Synced: 2025-03-25T03:12:40.890Z (10 months ago)
- Language: Shell
- Size: 1000 Bytes
- Stars: 6
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dosu
Switch user then execute a command.
Usage: `dosu user command [args...]`
The command will not run in a child process, but will be executed
in place, thus avoiding TTY and signal propagation issues in docker
entry points.
```
$ docker run -ti --rm alpine:edge su -c 'ps aux'
PID USER TIME COMMAND
1 root 0:00 ash -c ps aux
6 root 0:00 ps aux
$ docker run -ti --rm -v $PWD/dosu:/sbin/dosu alpine:edge dosu root ps aux
PID USER TIME COMMAND
1 root 0:00 ps aux
```
## Why reinvent gosu ?
It takes 174 bytes of portable shell instead of 1.8 MB of binary code.
## License
[ISC License](./LICENSE)