10/9/2021 0 Comments Docker For Mac Docker_Host
Install Docker ♪lternatively, you can install Docker using Homebrew: brew install homebrew/cask/docker OPTION 1: Run Postgres using a single Docker command ¶ Run a postgres container I also wrote some notes on Postgres and Homebrew here. Currently I use the Homebrew Postgres for work, and Postgres in Docker for personal projects. We use Docker extensively at work, so from a mental overhead point of view, it's something I wanted to learn anyways. Admittedly, I didn't know Homebrew well, but it was frustrating.) Disadvantages of Docker are it's another layer of abstraction to learn and interact with. (I previously had a problem where Homebrew upgraded Postgres when I didn't expect it to and my existing database became incompatible.sets the postgres superuser password to "my_password" using -e and the POSTGRES_PASSWORD environment variable.Create a new file docker-compose.yml: version: "3" uses the -d flag to run in the background exposes port 54320 to the host using -p uses a named volume, my_dbdata, to store postgres data sets the postgres superuser password to "my_password" using the environment key and the POSTGRES_PASSWORD environment variable creates a container named "my_postgres" using the container_name key uses the postgres:13 image from hub.docker.com using the image key
![]() Docker Docker_Host Install Docker Usingfor more information, see the Docker Compose file referencePull the postgres image from hub.docker. Even if the container and image are deleted, the volume will remain unless explicitly deleted using docker volume rm. uses a named volume, "my_dbdata", for storing the database data using the volumes key.
0 Comments
Leave a Reply. |
AuthorMatt ArchivesCategories |