November 2018
Beginner
230 pages
6h 4m
English
Suppose you have a running container. It is currently detached from your terminal session. You can use the container attach command to bring that container's executing process to be the foreground process of your terminal session. Let's use the web-server example we used earlier:
# run a container detacheddocker container run --detach -it --name web-server1 -p 80:80 nginx# show that the container is runningdocker container ps# attach to the container# Usage: docker container attach [OPTIONS] CONTAINERdocker container attach web-server1# issue a Ctrl + PQ keystroke to detach (except for Docker on Mac, see below for special Mac instructions)# again, show that the container is running detached.docker container ps ...Read now
Unlock full access