Docker Community Forums

Share and learn in the Docker community.

Run -it then 'detach' & persist

Hi All

I’ve got an image which runs a bash script which requires user input. The bash script then starts a long-running program.

Is it possible to call docker run -it <image> so that we can receive user input, then somehow detach the container, after user input has been received?

Sorry if this has been asked before, couldn’t find any topic which looked like this.

Thanks

Hi

You should be able to run it with " - tid " and then use:

But also, you should check if the script does accepts arguments, so you dont have to ninja it this way :slight_smile:

1 Like