in reply to IPC::Run3 not working as expected when running Docker command

I have to say, whatever you're trying to do here seems to be the wrong way to accomplish it.

If you want a docker container to run in the background, I would think you'd want "docker create". The only advantage of "run -d" is that it doesn't exist after reboot. Is that really all you want? If you want it to only run for the duration of your perl script, then why use "-d"? You can just keep the IPC::Run instance open in the background.

Second, why run /bin/sh? You could just [ 'docker', 'run', '-d', '--name', 'xxxyyyzzz-blah', 'alpine', '/usr/bin/tail', '-f', '/dev/null' ]

Third, if you are creating this container so that you can then 'docker exec' various things in it, you probably want the '--init' option so that there is a proper PID 1 inside the container to reap processes and respond to signals.

Fourth, if your goal is, in fact, to exec things in a shared container, you might consider just running each process in its own container on a shared filesystem. Linux namespaces are fairly cheap, and the "docker-correct" way of approaching the problem is to run each process with its own "docker run" command.