How do you write a list of all running Docker containers to a file file.txt?
Experience Level: Junior
Tags: DockerDocker CLI
Answer
Run the following command:
docker ps > file.txt
Related Docker job interview questions
Are Docker instructions case sensitive?
Docker SeniorHow can you add comments to your Dockerfile?
Docker SeniorHow do you run a docker image app1 in detached mode and name the container mycontainer1?
DockerDocker CLI JuniorHow do you display logs of a docker container?
DockerDocker CLI JuniorHow do you send a locally build image img1 to a docker registry reg.local:5000?
DockerDocker CLIKubernetes Junior