Skip to content

Instantly share code, notes, and snippets.

View abbas-v1's full-sized avatar

Abbas Muhammad abbas-v1

View GitHub Profile
@abbas-v1
abbas-v1 / customized-database-container
Created June 25, 2019 12:30
Create a database image from a container
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
@abbas-v1
abbas-v1 / databases-docker
Last active July 8, 2019 15:15
Databases on Docker
// MySQL
docker run -p 3306:3306 --name some-mysql -e MYSQL_ROOT_PASSWORD=yousafzai -d mysql
sudo docker inspect some-mysql
docker exec -it some-mysql bash
mysql --password
create database db_example;
create user 'springuser'@'%' identified by 'ThePassword';
grant all on db_example.* to 'springuser'@'%';
// Postgres
@abbas-v1
abbas-v1 / git-commands
Last active December 2, 2023 09:33
Common GIT commands
Clone a remote repository on your local machine
```
git clone <repository_url>
```
List all local branches
```
git branch
```