Dockerized H2 database service.
- Based on the
OpenJDK
official image - H2-DATA location on
/opt/h2-data
- A mix of zhilvis/docker-h2 and zilvinasu/h2-dockerfile.
Automated builds on docker registry:
latest
,1.4.199
(1.4.199/Dockerfile)alpine
(alpine/Dockerfile)1.1.119
(1.1.119/Dockerfile)geodb
(geodb/Dockerfile)
Get the image:
docker pull oscarfonts/h2
Run as a service, exposing ports 1521 (TCP database server) and 81 (web interface) and mapping DATA_DIR to host:
docker run -d -p 1521:1521 -p 81:81 -v /path/to/local/data_dir:/opt/h2-data --name=MyH2Instance oscarfonts/h2
Or run as a service with an extra custom config set in the command line, like allowing to create database at connection:
docker run -d -p 1521:1521 -p 81:81 -v /path/to/local/data_dir:/opt/h2-data -e H2_OPTIONS=-ifNotExists --name=MyH2Instance oscarfonts/h2
The H2 web console will be available at: http://localhost:81
See the logs while running:
docker logs -f MyH2Instance