As we try to start container, it execute bash, and bash is not able to find controlling terminal due to which docker container for centos immediately stopped as it forms. To provide it terminal as well as run it in detach mode you can use:
docker container run -it --name centos7 -d centos:latest
This will run docker container in detach mode and also assign controlling terminal to bash due to which container will not stop.
Later to enter into container you can use:docker container exec -it <container-id> bash
Tidak ada komentar:
Posting Komentar