docker run -it \\
-e POSTGRES_USER="root" \\
-e POSTGRES_PASSWORD="root" \\
-e POSTGRES_DB="ny_taxi" \\
-v /ny_taxi_postgres_data:/var/lib/postgresql/data \\
-p 5432:5432 \\
postgres:13
Here are more content about how we could use docker command-line option correctly:
a, --attach
: Attach to STDIN, STDOUT, or STDERRd, --detach
: Run container in background (daemon mode)i, --interactive
: Keep STDIN opent, --tty
: Allocate a pseudo-TTY-name
: Assign a name to the containere, --env
: Set environment variables-env-file
: Read environment variables from a fileu, --user
: Username or UIDw, --workdir
: Working directory inside the container-entrypoint
: Override the default ENTRYPOINTp, --publish
: Publish container's port(s) to the hostP, --publish-all
: Publish all exposed ports-network
: Connect container to a networkh, --hostname
: Container host name