introduceThe project recently upgraded the Posgres database from 9.6 to 12+. In order to do some migration tests, I need to install several versions of Postgres locally. The most convenient way is to install it using Docker. There is no version conflict problem, and it is easy to manage and delete. It is also recommended to use docker-compose or stack. Simply put, the data can be stored locally, so that the data will not be lost each time it is restarted and can be reused. If you are doing integration testing, you can start a new DB each time. The following docker-compose file also contains pgAdmin, which makes it easier to use Postgres. You can also use your favorite DB browser. I use the Database plugin that comes with IDEA (ultimate). Support Intel CPUI used it for a while under MacOS and it was fine.
illustrate:
version: '3.5' services: postgres: container_name: pg12 image: postgres:12 environment: POSTGRES_USER: pg12 POSTGRES_PASSWORD: pg12 PGDATA: /data/postgres volumes: - postgres12:/Users/szhang/postgresql/pg12 ports: - "5432:5432" networks: - pg12 restart: unless-stopped pgadmin: container_name: pgadmin12 image: dpage/pgadmin4 environment: PGADMIN_DEFAULT_EMAIL: [email protected] PGADMIN_DEFAULT_PASSWORD: [email protected] volumes: - pgadmin12:/Users/szhang/postgresql/.pgadmin12 ports: - "27777:80" networks: - pg12 restart: unless-stopped networks: pg12: driver: bridge volumes: postgres12: pgadmin12: Support for Apple M1The only difference in this version is that the Postgres image is an ARM version, which specifically supports computers with the latest Apple M1 chip. One more thing, Apple M1 computers can run Docker, but many Docker images do not have ARM versions yet, so it is not convenient to use M1 computers for development (which requires Docker) at present. version: '3.5' services: postgres: container_name: pg12 image: arm64v8/postgres:12.6 environment: POSTGRES_USER: pg12 POSTGRES_PASSWORD: pg12 PGDATA: /data/postgres volumes: - postgres12:/Users/shubozhang/dev/postgresql/pg12 ports: - "5432:5432" networks: - pg12 restart: unless-stopped pgadmin: container_name: pgadmin12 image: dpage/pgadmin4 environment: PGADMIN_DEFAULT_EMAIL: [email protected] PGADMIN_DEFAULT_PASSWORD: [email protected] volumes: - pgadmin12:/Users/shubozhang/dev/postgresql/.pgadmin12 ports: - "27777:80" networks: - pg12 restart: unless-stopped networks: pg12: driver: bridge volumes: postgres12: pgadmin12: testpgAdmin Log in, using the email and password in docker-compose User Interface Intellij IDE Use username, password, and port to connect. This is the end of this article about installing Postgres 12 + pgadmin (supporting Apple M1) with local Docker. For more relevant content about installing Postgres with Docker, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Vue-CLI3.x automatically deploys projects to the server
>>: Detailed explanation of MySQL binlog usage
This article introduces how to create an index on...
This article shares the specific code of a simple...
Download the zip installation package: Download a...
The cut command in Linux and Unix is used to cu...
Table of contents Preface Background Implementati...
Table of contents 1. Installation 2. Import into ...
Execute the following command to report an error ...
Background Recently, when writing SQL statements,...
MySQL transaction support is not bound to the MyS...
Table of contents 1. List traversal 2. The role o...
Table of contents Preface 1. Less 2. Import your ...
This article shares the specific code for JavaScr...
Preparation 1. Check whether the GPU supports CUD...
Table of contents 1. Integrate Ant Design Vue 2. ...
Table of contents Use two-way binding data in v-m...