Install with Docker
You can install and run Relational Migrator as a Docker container. Running Relational Migrator with Docker ensures an installation process that is both independent of the operating system and straightforward to replicate.
About this Task
You can also use Docker Compose
to run Relational Migrator. You can find a Docker Compose example file
in the
download center.
If you use Docker Compose, you must set environment variables
for MIGRATOR_PATH_DATA
to the local path for the data volume mount
and MIGRATOR_PATH_DRIVER
to the path of the JAR file with the
JDBC drivers.
Before you Begin
Install Docker
Procedure
Run the Image as a Container
The tabs below show various docker commands that are useful for running Relational Migrator:
The -p 8080:8080
in this command maps the container port to the host port.
This allows you to connect to Relational Migrator by browsing to
http://localhost:8080:
docker run --name mongodb-relational-migrator -p 8080:8080 public.ecr.aws/v4d7k6c9/relational-migrator:latest
The following command makes the project files and logs persistent even if the container is stopped:
docker run --name mongodb-relational-migrator -p 8080:8080 -v c:\temp\migdocker\data:/root/Migrator public.ecr.aws/v4d7k6c9/relational-migrator:latest
The following command maps a single jar file that contains a JDBC driver to the container. This is useful for Oracle and MySQL migration projects because those drivers are not included with Relational Migrator by default:
docker run --name mongodb-relational-migrator -p 8080:8080 -v C:\Temp\migdocker\drivers\ojdbc11.jar:/opt/mongodb-relational-migrator/lib/app/lib/driver.jar public.ecr.aws/v4d7k6c9/relational-migrator:latest
Note
Override a Config Setting
You can specify a configuration setting to override in the Docker command. For example, consider disabling telemetry with the following command:
docker run --name mongodb-relational-migrator -p 8080:8080 -e MIGRATOR_APP_TELEMETRY_ENABLE=false public.ecr.aws/v4d7k6c9/relational-migrator:latest
Check that the Container is Running
To check the status of your Docker container, run the following command:
docker container ls
The output from the ls
command lists the following fields that
describe the running container:
Container ID
Image
Command
Created
Status
Port
Names
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 82b1f8adca43 public.ecr.aws/v4d7k6c9/relational-migrator:latest "/opt/mongodb-relati…" 46 seconds ago Up 44 seconds 0.0.0.0:8080->8080/tcp pedantic_kirch
Open the application
To view the application, navigate to: http://localhost:8080.
Note
If you changed the port number in the docker run
command,
you also need to change the port in the url above.