docker exec -it <ContainerName/ContainerID> bash
docker cp <file-path> <ContainerName>:<destinationPath>
-
Open cmd and pull the docker postgres image using command :
docker pull postgres
-
Wait for it download
-
Run the container using command :
docker run --name postgresContainer -e POSTGRES_PASSWORD=123 -d -p 5432:5432 postgres
-
Verify if the container is running using command :
docker ps
-
You can execute psql commands using command :
docker exec -it postgresContainer psql -U postgres
Where ContainerID is the ID you obtain from docker ps command
-
Once psql opens, use this command to create a test database :
create DATABASE test_db;
-
More docker resources : https://hub.docker.com/_/postgres/
-
Open cmd and pull the docker postgres image using command :
docker pull mysql
-
Wait for it download
-
Run the container using command :
docker run --name mysqlContainer -e MYSQL_ROOT_PASSWORD=123 -d -p 3306:3306 mysql
-
Verify if the container is running using command :
docker ps
-
You can execute psql commands using command :
docker exec -it mysqlContainer mysql --user=root --password
Where ContainerID is the ID you obtain from docker ps command
-
Enter the password.
-
Once mysql opens, use this command to create a test database :
create DATABASE test_db;
-
More docker resources : https://hub.docker.com/_/mysql/