Docker provides a convenient containerization, allowing to run UPPAAL under an environment different from the main operating system.
The instructions below show how to setup UPPAAL engine inside latest Ubuntu container.
sudo apt install docker.io
Download and extract/install UPPAAL for Linux.
Inside UPPAAL installation create uppaal-X.Y.Z/res/Dockerfile
file with the following content:
FROM ubuntu:latest
RUN useradd -ms /bin/bash uppaal
RUN apt-get -qq update && apt-get -qq upgrade
USER uppaal
ENV USER=uppaal
WORKDIR /home/uppaal
ADD . uppaal
ENV PATH="/home/uppaal/uppaal/bin:$PATH"
ARG KEY=""
ARG LEASE="1"
RUN verifyta.sh --key ${KEY} --lease ${LEASE}
RUN verifyta.sh --version
EXPOSE 2350
CMD /home/uppaal/uppaal/bin/socketserver.sh /home/uppaal/uppaal/bin/server.sh
cd uppaal-X.Y.Z
docker image build --build-arg KEY=$UPPAAL_LICENSE_KEY --tag uppaal-X.Y.Z -f res/Dockerfile .
where $UPPAAL_LICENSE_KEY
is your UPPAAL license key from uppaal.veriaal.dk.
docker run --rm -d -p 2350:2350 uppaal-X.Y.Z
where:
--rm
tells docker to delete the container (not the image) when the container is stopped.-d
dettaches the docker process from the current terminal.-p 2350:2350
maps the container’s port 2350 onto the host’s port 2350.uppaal.exe
or uppaal.jar
, or on command line:java -jar uppaal.jar
Select the remote engine: Edit
> Engine
> Remote
, then reload the connection: View
> Reload
.
The engine version is printed in Verifier
tab, Status
section at the bottom.
If the docker is running on a different than current machine, or the port number is different, then the Remote
engine can be configured accordingly in the Edit
> Engines
dialog.
UPPAAL engine exits (and releases the resources) when the UPPAAL GUI is closed or the engine connection is closed/reloaded (View
> Reload
), but the Docker container remains running in the background and ready for other connections.
If docker commands give permission errors on Linux, you may need to add your account to docker
group to be able to create docker images, so try the following:
sudo adduser $USER docker
then logout-login or reboot for the account changes to take effect.
If UPPAAL cannot connect to the remote engine, or docker container does not work, then start an interactive shell to investigate:
docker run --rm -it --entrypoint /bin/bash uppaal-5.0.0
For example:
verifyta
crashes right away).verifyta --version
verifyta --stdc-version
dpkg -l libc6
dpkg -S libc.so.6
/usr/lib/x86_64-linux-gnu/libc.so.6 --version
verifyta --version
crashes right away, then try using the wrapper script verifyta.sh
which forces to use the libraries shipped with UPPAAL instead of the host’s libraries.To stop the container, first find its identifier and then issue stop
or kill
command, for example:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
345c8263c4a8 uppaal-5.0.0 "./socketserver" 6 seconds ago Up 5 seconds 0.0.0.0:2350->2350/tcp modest_kare
docker stop modest_kare
Examine any remaining containers:
docker ps -a
The remaining stopped containers can be removed by:
docker rm modest_kare
(unnecessary when --rm
argument is used to start the container).
Remove the docker image:
docker rmi uppaal-X.Y.Z
Check the installed images:
docker images