Skip to content

Instantly share code, notes, and snippets.

@wesleyit
Created July 27, 2019 01:00
Show Gist options
  • Save wesleyit/9918e21331f7186ae80aa724a6c71c3e to your computer and use it in GitHub Desktop.
Save wesleyit/9918e21331f7186ae80aa724a6c71c3e to your computer and use it in GitHub Desktop.
Many databases running on Docker (for testing purposes)
docker run --name postgres \
-e POSTGRES_USER=pgadmin \
-e POSTGRES_PASSWORD=pgpasswd \
-e POSTGRES_DB=pgdb \
-v /my/own/datadir:/var/lib/postgresql/data \
-d postgres
docker run --name mysql \
-e MYSQL_USER=myadmin \
-e MYSQL_PASSWORD=mypasswd \
-e MYSQL_DATABASE=mydb \
-v /my/own/datadir:/var/lib/mysql \
-d mysql
docker run --name mssql \
-e 'ACCEPT_EULA=Y' \
-e 'SA_PASSWORD=Pipoca2019' \
-e 'MSSQL_PID=Express' \
-p 1433:1433 \
-v /my/own/datadir:/var/opt/mssql \
-d mcr.microsoft.com/mssql/server:2017-latest-ubuntu
docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Pipoca2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment