By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Create, manage, and delete containers. docker run.
docker ps -a
docker run -it --name mycontainer ubuntu
docker ps
docker pause mycontainer
docker stop mycontainer
docker rm mycontainer
docker container prune
docker run -d --name webserver -p 8080:80 nginx
-d
-p
--name
docker run -it --name myshell ubuntu
-it
docker run -e MY_VAR=hello -it --name mycontainer ubuntu
-e
MY_VAR
hello
docker: Error response from daemon: Container cannot be paused: container is not running.
docker start mycontainer
docker: Error response from daemon: Container cannot be stopped: container is not running.
docker: Error response from daemon: Container mycontainer is not running.
docker container ls -a
docker logs -f mycontainer
docker run
docker run [options] image [command] [args...]
docker run -p 8080:80
docker run -e MY_VAR=hello
docker run --name mycontainer
docker ps -q
docker system prune
docker volume prune
docker version
docker info
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.