Runtime.getRuntime().exec on host from inside a Docker process

I have a Java program that runs inside a Docker container. This program needs to execute a shell command that should be run by the host system, but just calling Runtime.getRuntime().exec(...) executes it inside the Docker container (as it should be).

Is there a way I can start a process from inside a container so the process runs outside? I suspect that the exec command should go via Docker to tell it that the command itself needs to be run on the host, but I’m not sure how to do that.

  • Cannot run JHipster docker
  • How do I use docker to run a gitlab-runner for a gitlab-hosted project?
  • Mac OS X Docker baseline aspnet error: libdl not found
  • How can ichange a virtualbox configuration using docker-machine
  • Deploy Docker environment on Elastic Beanstalk
  • openwhisk postdeploy fails on single node ubuntu virtual machine
  • Docker container doesn't reload Angular app
  • Docker automated build Error: Build failed: Dockerfile not found at ./Dockerfile
  • Set up swarm mode Docker Swarm using Vagrant
  • where are repo's automated build files located
  • Running out of inodes on a docker volume
  • Using gitlab-ci to build .NET Core projects in docker
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.