How to run in detached mode?

QuestionsQuestions8 SkillsProYour First Docker LabAug, 22 2025
0128

To run a Docker container in detached mode, you can use the -d option with the docker run command. Here’s an example:

docker run -d --name my-container nginx

In this command:

  • -d: Runs the container in detached mode (in the background).
  • --name my-container: Assigns the name "my-container" to the container.
  • nginx: Specifies the image to use (in this case, the Nginx image).

After running this command, the container will start in the background, and you can check its status using docker ps.

0 Comments

no data
Be the first to share your comment!