Skip to main content

Run on Docker

This tutorial shows how you can get started with DB2Rest in less than 10 minutes on Docker.

Minimum System Requirements

  • Java 21
  • 4-8 GB RAM/Memory.

1. Install Docker

To download the Docker desktop browse to this link. This page then shows options to download Docker for Mac, Windows, and Linux. Please click on the link for your operating system (OS) to start the download. After the download is completed, follow the steps outlined here pertinent to your OS, to install and test the Docker desktop.

2. Run DB2Rest

Now launch a terminal window to run the DB2Rest docker image. DB2Rest docker image is available on Dockerhub. It is assumed that a MySQL server has already been installed, started, and populated with Sakila database objects and data. MySQL Community Edition (CE) is available for download here.

Now in the terminal window run the following command:

$ docker run -e DB_URL=[DB URL] -e DB_USER=[User] -e DB_PASSWORD=[Password] kdhrubo/db2rest:latest
Sl#Parameter NameDescriptionExample
1.DB URLJDBC URL conneciton string- MySQL : jdbc:mysql://host.docker.internal:3306/sakila
- PostgreSQL : jdbc:postgresql://host.docker.internal:5432/sakila?currentSchema=public
2.DB_USERDatabase user
3.DB_PASSWORDDatabase password

This will start DB2Rest within seconds ready with to server API requests on the MySQL database.