Created
July 14, 2020 06:13
-
-
Save twitu/9a6b72d8d8a90a2715f5c47166615dfe to your computer and use it in GitHub Desktop.
Running MiniZincIDE AppImage in a Docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
RUN apt-get -y upgrade | |
RUN apt-get -y update | |
RUN apt-get install -y libglib2.0-dev libx11-dev libglu1-mesa-dev libfontconfig1 libasound2 libegl1-mesa dbus x11-xserver-utils wget dbus | |
RUN dbus-uuidgen > /var/lib/dbus/machine-id | |
RUN wget -c https://github.com/MiniZinc/MiniZincIDE/releases/download/2.4.3/MiniZincIDE-2.4.3-x86_64.AppImage -O minizinc.AppImage | |
RUN chmod +x minizinc.AppImage | |
RUN ./minizinc.AppImage --appimage-extract | |
CMD ["/squashfs-root/AppRun"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Linked to issue MiniZinc/MiniZincIDE#108
The Docker file downloads required graphical packages, downloads and extracts minizinc and sets up a command to run it. The following steps should get your IDE running on a linux system. I have tested it for my Ubuntu 20.04 system.
minizinc.docker
docker build -t minizinc-gui -f minizinc.docker .
xhost +local:docker
sudo docker run -ti --rm --net=host -e DISPLAY=:1.0 -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority -v /home/code/basic-discrete-optimization/:/home/basic --env="QT_X11_NO_MITSHM=1" --privileged minizinc-gui
The
-v /home/code/basic-discrete-optimization/:/home/basic
creates a volume that links the code directory in your local system with ahome/basic
directory inside the docker container. Change it according to your needs.I do not know the exact purpose of all the options used here, they are cobbled together from different SO answers. Please correct me if there's a better solution.