1、MySQL数据库
mkdir -p data
docker run -t -d --privileged --name mysql \
-e MYSQL_USER="test" \
-e MYSQL_PASSWORD="123456" \
-e MYSQL_ROOT_PASSWORD="123456" \
-e MYSQL_ROOT_HOST="%" \
-v $(pwd)/data:/var/lib/mysql \
-p 3306:3306 \
mysql/mysql-server:5.7
账号:test/123456 和 root/123456
2、PostgreSQL数据库
mkdir -p data
docker run -t -d --privileged --name postgis -e POSTGRES_USER=postgres -e POSTGRES_PASS=123456 -v $(pwd)/data:/var/lib/postgresql -p 5432:5432 kartoza/postgis:11.0-2.5
账号: postgres/123456
3、Oracle数据库
-
oracle-12c
hostname: localhost
port: 1521
sid: xe
service name: xe
username: system
password: oracle
mkdir -p data
docker run -d --name oracle12c -p 8080:8080 -p 1521:1521 -v $(pwd/data:/mnt -e "TZ=Asia/Shanghai" sath89/oracle-12c
账号: system/oracle service name: xe
-
oracle-11g
docker run -d --privileged -p 1521:1521 --name=oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
账号: system/helowin serviceid: helowin
4、SQLServer数据库
mkdir -p data
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=abc@1234' -p 1433:1433 -v $(pwd)/data:/var/opt/mssql/data/ --name sqlserver -d mcr.microsoft.com/mssql/server:2017-latest
说明: 密码需要满足要求,否则报错:
ERROR: Unable to set system administrator password: Password validation failed. The password does not meet SQL Server password policy requirements because it is too short. The password must be at least 8 characters..
账号: sa/abc@1234
5、Sybase数据库
#
# https://blog.csdn.net/scp__001/article/details/116694147
#
# SYBASE_USER: tester
# SYBASE_PASSWORD: guest1234
# SYBASE_DB: testdb
# ==========================
# DBA_USER: sa
# DBA_PASSWORD: myPassword
#
mkdir -p $(pwd)/data
docker run -d --name sybase -p 5000:5000 -v $(pwd)/data:/data:rw datagrip/sybase
账号: tester/guest1234 和 sa/myPassword
6、DB2数据库
cat sbin/entrypoint.sh
#!/bin/bash
su - db2inst1 -c "db2start"
nohup /usr/sbin/sshd -D 2>&1 > /dev/null &
su - db2inst1 -c "db2sampl"
while true; do sleep 1000; done
docker run -itd --name db2 --privileged=true \
-p 50000:50000 \
-v $(pwd)/sbin/entrypoint.sh:/docker-entrypoint.sh \
-e "DB2INST1_PASSWORD=Test@123" \
-e "LICENSE=accept" \
ibmoms/db2express-c:10.5.0.5-3.10.0 \
sh /docker-entrypoint.sh
账号: db2inst1/Test@123
7、DM数据库
mkdir -p data
docker run -d --net host --name dm8 -p 5236:5236 -v $(pwd)/data/:/opt/dmdbms inrgihc/dmdb:v8
账号: SYSDBA/SYSDBA
8、Kingbase数据库
需要去官网上下载licence文件
-
v8r6
https://github.com/chyidl/kingbase-es-v8-r6-docker
jdbc:kingbase8://172.16.1.83:54321/test_database
user: admin password: 123456
docker run -d --name kingbase -p 54321:54321 -e SYSTEM_USER=admin -e SYSTEM_PWD=123456 -v /home/kingbase/license.dat:/opt/kingbase/Server/bin/license.dat chyiyaqing/kingbase:v8r6
sleep 20
docker cp /root/kingbase/license_18720_0.dat kingbase:/opt/kingbase/license.dat
docker exec -u root -it kingbase bash -c 'chown -R kingbase:kingbase license.dat'
docker restart kingbase
sleep 10
docker exec -u root -it kingbase bash -c 'createdb -U admin test_database' -
v8r3
https://toscode.mulanos.cn/rnf/kingbase-es-v8-r3-docker
docker run -d --name kingbase -p 54321:54321 -e SYSTEM_PWD=SYSTEM -v /opt/kingbase/data:/opt/kingbase/data -v /opt/kingbase/license.dat:/opt/kingbase/Server/bin/license.dat kingbase:v8r3
9、OpenGuassM数据库
mkdir -p data
docker run --name opengauss -d --restart always --privileged=true -e GS_PASSWORD='openGauss@123' \
-v $(pwd)/data:/var/lib/opengauss/data -u root -p 15432:5432 \
opengauss/opengauss:5.0.0
账号: gaussdb/openGauss@123
10、Greenplum数据库
mkdir -p data
docker run -d --name greenplum -p 25432:5432 -v $(pwd)/data:/data inrgihc/greenplum:6.19.3
账号:gpadmin/greenplum
11、GBase数据库
# DB: gbase
# User: root
# Password: root
# Port: 5258
#
docker run -d --name gbase8a --hostname=gbase8a --privileged=true -p5258:5258 shihd/gbase8a:1.0
账号:root/root
12、hive V2数据库
地址:https://github.com/big-data-europe/docker-hive.git
git clone https://github.com/big-data-europe/docker-hive.git
cd docker-hive/
docker-compose up -d
无需账号
13、polarDB数据库
docker run -d --name polardb -p 8528:8527 polardbx/polardb-x
账号:polardbx_root/123456
14、clickHouse数据库
docker run -d --name clickhouse -p 8123:8123 -p 9000:9000 -p 9001:9001 yandex/clickhouse-server
账号:default/(空)
15、Mongo数据库
mkdir -p data
docker run -itd --name mongo -v ${pwd}/data:/data/db -p 27017:27017 mongo:4.4 --auth
# docker exec -it mongo mongo admin
# db.createUser({ user:'root',pwd:'123456',roles:[ { role:'userAdminAnyDatabase', db: 'admin'},'readWriteAnyDatabase']});