96 words
1 minutes
Detached Mode in Docker
To run a container in the background, allowing it to operate independently while freeing up your command line, you can use the -d
or --detach
switch with the docker run command.
Running a container in detached mode means that you immediately get your command-line back and the standard output from the container is not redirected to your command-line anymore. For example, if you want to run a continuous ping command inside a container, you could use the lightweight Alpine Linux image. Here’s how you can do it using the given terminal command:
docker run -d alpine ping google.com
Detached Mode in Docker
https://rabisiddique.com/posts/docker-detached-mode/Author
Rabi Siddique
Published at
2024-09-10