can a dockerised app execute script on the host?

If I have an application running in a docker container, is it possible to have it execute a shell script on the host? I’m pretty sure there is no way to achieve this – on purpose, such is the nature of containers – but want to check. Thanks.

EDIT: and failing that, is there a way for the app to interact with the docker engine running on the host so that it can trigger a “docker stop” “docker run..” etc for other containers.

  • Passing a command with arguments as a string to docker run
  • Docker and Kubernetes repository for linux
  • Docker-Machine AWS Policies
  • how to map a local folder as the volume the docker container or image?
  • Docker rsyslog driver add message length before actual message
  • Docker: elastic search image with preloaded schema/data
  • Remote Docker daemon with public access from any client?
  • Determining if a process runs inside lxc/Docker
  • Store Docker image files in external drive in El Capitan OSX
  • Play framework auto-loading in docker container
  • Can not ping docker in macOS
  • Docker and Namespace-related errors after a successful login to Bluemix
  • One Solution collect form web for “can a dockerised app execute script on the host?”

    Well, technically, it does. Processes are run on the host even when from inside a container. You can verify this when running ps aux as root on the host : you’ll see the dockerized processes.

    The question is : what interaction is your script supposed to have with the system ? If it’s taking files as input, accessing databases or network resource, then all of this is possible for a dockerized script. You’ll just have to define volumes and links.

    About the docker engine : yes it is also possible for a container to control its own docker engine. You just have to add this to the docker command :

    -v /var/run/docker.sock:/var/run/docker.sock

    That way, a docker client (inside the container) will have access to the docker engine (via docker API).

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.