Please note! This Docker setup is not for production!
Assuming you have Docker, Docker Desktop, Moby or some remote Docker host configured, up and running from here on. Also assuming you have Java and Maven installed, as you are at least about to develop code changes.
To test drive these local changes to the Dataverse codebase in a containerized application server (and avoid the setup described in Development Environment), you must a) build the application and b) run it in addition to the necessary dependencies. (Which might involve building a new local version of the Config Baker Image.)
mvn -Pct clean package
Once this is done, you will see images
gdcc/configbaker:unstable available in your
Note: This will skip any unit tests. If you have built the code before for testing, etc. you might omit the
clean to avoid recompiling.
Note: Also we have a
docker-compose-dev.yml file, it’s currently not possible to build the images without
invoking Maven. This might change in the future.
After building the app and config baker image containing your local changes to the Dataverse application, you want to run it together with all dependencies. There are four ways to do this (commands executed at root of project directory):
Both ways have their pros and cons:
In case you want to concatenate building and running, here’s a cheatsheet for you:
Once all containers have been started, you can check if the application was deployed correctly by checking the version at http://localhost:8080/api/info/version or watch the logs.
Note: To stop all containers you started in background, invoke
mvn -Pct docker:stop or
docker compose -f docker-compose-dev.yml down.
Check that you can log in to http://localhost:8080 using user
dataverseAdmin and password
You can also access the Payara Admin Console if needed, which is available at http://localhost:4848. To log in, use
admin and password
admin. As a reminder, the application container is for development use only, so we
are exposing the admin console for testing purposes. In a production environment, it may be more convenient to leave
this console unopened.
Note that data is persisted in
./docker-dev-volumes in the root of the Git repo. For a clean start, you should
remove this directory before running the
mvn commands above.
In case you started containers in background mode (see Running), you can use the following commands to view and/or watch logs from the containers.
The safe bet for any running container’s logs is to lookup the container name via
docker ps and use it in
docker logs <name>. You can tail logs by adding
-n and follow them by adding
-f (just like
docker logs --help for more.
In case you used Maven for running, you may use
mvn -Pct docker:logs -Ddocker.filter=<service name>.
If you used Docker Compose for running, you may use
docker compose -f docker-compose-dev.yml logs <service name>. Options are the same.
The safest way to redeploy code is to stop the running containers (with Ctrl-c if you started them in the foreground) and then build and run them again with
mvn -Pct clean package docker:run.
The following steps are suggested:
Install Payara Platform Tools.
Click “Run” then “Edit Configurations”.
Click the plus sign and scroll down to Payara Server and click “Remote”.
For “Name” put “Payara in Docker” or something reasonable.
Under “Application server” select a local directory that has the same version of Payara used in the container. This should match the version of Payara mentioned in the Installation Guide under Payara.
Change “Admin Server Port” to 4849.
For username, put “admin”.
For password, put “admin”.
Click the plus button and clien “Artifact” then “dataverse:war”.
Click “Debug” and change the port to 9009.
Click “Run” and then “Debug Payara in Docker”. This initial deployment will take some time.
Go to http://localhost:8080/api/info/version and make sure the API is responding.
Info.javaand make a small change to the
Click “Run” then “Debugging Actions” then “Reload Changed Classes”. The deployment should only take a few seconds.
Go to http://localhost:8080/api/info/version and verify the change you made.
The Application Base Image enables usage of the Java Debugging Wire Protocol
for remote debugging if you set
ENABLE_JDWP=1 as environment variable for the application container.
The default configuration when executing containers with the commands listed at Running already enables this.
There are a lot of tutorials how to connect your IDE’s debugger to a remote endpoint. Please use
as the endpoint. Here are links to the most common IDEs docs on remote debugging: