dpkg -l | grep postgres
docker run --rm -it -p 5432:5432 postgres:10
docker run --name postgres1 -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:10
docker exec -it postgres1 /bin/bash
$ psql -U postgres -h localhost
$ CREATE DATABASE aiohttpdemo_polls;
$ CREATE USER aiohttpdemo_user WITH PASSWORD ‘aiohttpdemo_pass’;
$ GRANT ALL PRIVILEGES ON DATABASE aiohttpdemo_polls TO aiohttpdemo_user;
退出container
ctrl + D
apt-get update
apt-get install vim
https://hub.docker.com/_/postgres/
docker exec -it 3cb492a27475 /bin/bash
安装防火墙
sudo apt install ufw