赞
踩
docker run postgres --env HTTP_PROXY="socket5://192/168/1/105:1081" -e POSTGRES_PASSWORD=123456
docker pull postgres:9.6.17
docker inspect postgres:9.6.17
What is different of Config and ContainerConfig of docker inspect?
docker network ls
NETWORK ID NAME DRIVER SCOPE
52fad4374751 bridge bridge local
cab444d41edc host host local
92aa63d09f76 none null local
$ docker run --name my_pg9.6_2 -e POSTGRES_PASSWORD=xxx -v /mnt/pgdata1/:/var/lib/postgresql/data/ --network c2c79ef52c7e -p 15432:5432 -d postgres:9.6.17
65262a17ae01e9c8346b4d00524a272488808c69a513498d5296459926d06969
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
65262a17ae01 postgres:9.6.17 "docker-entrypoint.s…" 6 seconds ago Up 3 seconds 0.0.0.0:15432->5432/tcp my_pg9.6_2
54b8fa0923eb postgres "docker-entrypoint.s…" 22 hours ago Exited (1) 22 hours ago focused_kapitsa
33c38803545b postgres "docker-entrypoint.s…" 22 hours ago Exited (1) 22 hours ago affectionate_hellman
docker logs 6526
docker exec -it my_pg9.6_2 psql -U postgres
docker exec -it my_pg9.6_2 bash
postgres=# create role dev;
postgres=# create user dev_usr;
postgres=# grant dev to dev_usr;
postgres=# create database db1;
postgres=# \c db1;
db1=# create schema business;
db1=# grant all privileges on schema business to dev;
db1=# alter database db1 set search_path to 'business,public';
db1=# alter database db1 owner to dev;
db1=# alter user dev_usr encrypted password 'zjhello';
db1=# create table business.aaa (aa int);
在上面增加一行
local dev_usr db1 192.168.33.10 md5
how to see the dockerfile of an image?
how to run a command in a container?
docker exec -it my_pg1
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。