Sobes.tech
Junior — Middle

What command in Docker is used to start a container?

sobes.tech AI

Answer from AI

The command used to start a container in Docker is:

docker run [options] <image> [command]

Example of starting a container with an interactive console based on the Python image:

docker run -it python:3.9 bash

Main options:

  • -d — run in detached mode
  • -p — port forwarding (e.g., -p 8080:80)
  • --name — assign a name to the container

Thus, the docker run command creates and starts a new container from the specified image.