Created
June 25, 2019 12:30
-
-
Save abbas-v1/e3d4d099878bbbfe66ffff8d32a7cff2 to your computer and use it in GitHub Desktop.
Create a database image from a container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -p 5432:5432 --name some-postgres -e PGDATA=/var/lib/postgresql/pgdata -e POSTGRES_PASSWORD=MyPa@@W0rd -d postgres | |
populate the database ... | |
docker commit some-postgres myAccount/repo-name:1.0 | |
make sure the data is now persisted in the new image | |
docker run -p 5432:5432 --name persistent-postgres -d myAccount/repo-name:1.0 | |
docker login -u myAccount | |
docker push myAccount/repo-name:1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment