简体   繁体   中英

How can I keep a docker debian container open?

I want to use a debian Docker container to test something, and by this I mean execute some commands in the debian bash console. I tried downloading the image using docker pull debian and then running it using docker run debian , but I get no output. What am I doing wrong? Shouldn't the docker container stay open until I close it?

You need to explicitly run bash:

docker run -it debian /bin/bash

The -i means "run interactively", and -t means "allocate a pseudo-tty".

A good place to read a bit more is the section Running an interactive shell in the Quickstart documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM