Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Does anyone know the command for loading postgres through docker? Here is the recommended command on their documentation:

docker run -it --rm --network some-network postgres psql -h some-postgres -U postgres

Forgive the naive question, how do you find what values for "some-network" are supposed to be and what values "some-postgres" is supposed to be?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
141 views
Welcome To Ask or Share your Answers For Others

1 Answer

To be precise, each flag has a own meaning in the docker run command.

docker run -it --rm --network some-network postgres psql -h some-postgres -U postgres

-i: Keep STDIN open even if not attached

-t: Allocate a pseudo-TTY

--rm: Automatically remove the container when it exits

--network: Connect a container to a network. You can ignore this if you are running a standalone postgress container or you can use host mode if you want the container to use host networking. For more information and modes. Check below article.

Ref:- https://docs.docker.com/network/

psql -h some-postgres -U postgres : Final command you are passing to postgres


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...