1. 拉镜像 ```shell docker pull postgres

    超时报错

    error pulling image configuration: Get “https://registry-1.docker.io/v2/library/postgres/blobs/sha256:b088818aeb7c28aec7aa27198b7cfaecb36ad2c314a7b71595385a79c582543d“: net/http: TLS handshake timeout

    解决方案:换镜像源

    https://cloud.tencent.com/developer/article/1842259

// 查看image景象

docker images

  1. 2. 启动镜像
  2. ```shell
  3. docker run --name postgres2 -d -p 5432:5432 -e POSTGRES_PASSWORD=123456 postgres
  4. // 查看container
  5. docker container list
  6. // 关闭
  7. docker container kill <id>
  8. // 删除
  9. docker container rm <containerId>
  1. 进入容器 ```shell // docker exec -it psql -U

docker exec -it postgres psql -U postgres

// 或者 docker exec -it psql -U postgres

  1. 4. 查看数据库
  2. ```shell
  3. \l