There's a Docker container for Postgres. Here's how to use it.
Create DockerUnder Docker Shell:
docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres docker rm -f postgres Important: Docker containers are code only - no persistence. This database will lose all data, tables etc, when you stop the container. It is therefore useful for demos and experiments, but not for production. Connect with Live API Creator Now you can connect like this:
Docker database imagesMySQLVersions available: 5.5, 5.6, 5.7 docker run --name MySQL56 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=Password1 -d mysql:5.6 Connecting Host name: 192.168.99.100 (usually) Port: 3306 User: root Password: Password1 DB2DB2 is different – you have to run a few manual commands. Leave the terminal open. Version 10.5: docker run --name DB2_10 -i -t -p 50000:50000 -e DB2INST1_PASSWORD=expresso123 -e LICENSE=accept ibmcom/db2express-c:latest bash Then: su - db2inst1 ConnectingHost name: 192.168.99.100 (usually) Port: 3306 User: db2inst1 Password: expresso123 Database: SAMPLE OracleVersion 11g docker run -d -p 1521:1521 wnameless/oracle-xe-11g ConnectingHost name: 192.168.99.100 (usually) Port: 1521 SID: xe User: system Password: oracle PostgresVersions available: 9.1, 9.2, 9.3, 9.4, 9.5 docker run -d --name Postgres95 -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword postgres:9.5 Connecting Host name: 192.168.99.100 (usually)
Port: 5432 Database: postgres User: postgres Password: mysecretpassword
|
Tech Blog >