security - Execute host commands from within a docker container -
i'm looking way user able execute limited set of commands on host, while accessing containers/browser. goal prevent need ssh'ing host run commands make start
, make stop
, etc. these make
commands execute series of docker-compose
commands , needed in dev.
the 2 possible ways in can think of are:
- via cloud9 terminal inside browser (we'll using it). default terminal accesses container of course.
- via custom mini webapp (e.g. node.js/express) buttons map commands. easy if running on host itself, want keep code containers.
although might not best practice still possible control host inside container. if running docker-compose commands can bind mount docker socket using -v /var/run/docker.sock:/var/run/docker.sock
on ubuntu. if want use other system tools have bind mount required volumes using -v
gets tricky , tedious when want use system bins use /lib.*.so
files.
if need use sudo
commands don't forget add --privileged
flag when running container
Comments
Post a Comment