#dockerizepostgresql #runpostgresqlinsidedocker #installpostgresqlinsidedocker #installpostgresqlinsidecontainer
How to add postgresql to docker container(Containerize postgresql)
Prerequisite
make sure your machine has installed docker
make sure you have internet connection
make sure your docker running, check if your docker running(linux : sudo systemctl status docker
windows : docker --version if docker is installed while run this command you should get response/ no response error)
Add postgresql to docker container and open postgresql with database client like(dbeaver or other)
1. add postgresql image to local registry
run this command = docker pull postgres:11.14 this command will add postgresql image to local registry with postgresql version 11.14
if you want to add postgresql latest version run this command docker pull postgres(you have 2 docker image in local registry latest version and 11.14. version)
2. create container and install postgresql to container, with set username and password postgresql in first time
if you add docker image to local registry with spesific version (11.14) run this = docker run --name containername -e POSTGRES_PASSWORD=mysecretpassword -d postgres:11.14
if you want to add postgresql image with latest postgressql version run this command = docker run --name postgresql_docker -e POSTGRES_PASSWORD=mysecretpassword -d postgres
3. check postgresql container with this command = docker ps -a
4. check docker container ip address
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' postgresql_docker
5. check if postgresql installed on container(open using db client like dbeaver)
Success, see you at the next tutorial !!!
Смотрите видео How to add postgresql to docker container/containerize postgresql онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Programming Tutorial 25 Ноябрь 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 85 раз и оно понравилось like людям.