Run Docker Container in Background

Run a container in the background with a name, port mapping, and restart policy.

Runs a container in detached (background) mode with a custom name. --name makes it easy to reference with docker stop/logs/exec. Without -d the container blocks the terminal.

When you need this: When starting a service container (database, cache, proxy) that should run continuously.

Variables

Command


        
8 views 0 copies
Log in to rate
Log in to save

Free account. Save snippets into your own collections.