I showcase how we can create a docker container running a PostgreSQL Database. We then add some SQL to the database, and go into the container to access the database to check everything works as intended.
Dockerfile:
FROM postgres
ENV POSTGRES_PASSWORD docker
ENV POSTGRES_DB user
COPY /docker-entrypoint-initdb.d/
Commands:
Build docker image:
docker build -t dbpost .
Run doker contianer from image:
docker run -d --name my-postgresdb-container -p 5432:5432 dbpost
Get into the docker container:
docker exec -it [container id] /bin/bash
Get into postgreSQL:
psql -U postgress
My channel publishes programming and software engineering videos, especially Java and Python. If that is what you are looking for, do not hesitate to join me on this journey!
Subscribe to my YouTube channel:
0:00 Intro
0:35 Dockerfile
1:14 Docker build
8 views
760
212
1 day ago 00:03:43 1
This Printer Cuts Stickers by Itself?! Meet PixCut S1 – Your DIY Sidekick Just Got Smart! - YouTube
2 days ago 00:03:56 1
Residential Proxy : Secrets You MUST Know! | Proxy4U!
4 days ago 00:02:47 7
ENHYPEN (엔하이픈) ’Bad Desire (With or Without You)’ Official MV