-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfileDebian
More file actions
65 lines (48 loc) · 2.48 KB
/
Copy pathDockerfileDebian
File metadata and controls
65 lines (48 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Please install docker according to the guideline provided here: https://docs.docker.com/engine/install/ubuntu/
FROM debian:latest
ARG DEBIAN_FRONTEND=noninteractive
# Install some basic packages
RUN apt-get update && apt-get install -y build-essential git cmake wget curl python3 python3-pip python3-dev python3-full
# Install the latest version of MiniZinc dynamically
WORKDIR /home/tools/
RUN LATEST_MINIZINC_VERSION=$(curl -s https://api.github.com/repos/MiniZinc/MiniZincIDE/releases/latest \
| grep -oP '"tag_name": "\K[^"]+') \
&& wget "https://github.com/MiniZinc/MiniZincIDE/releases/download/${LATEST_MINIZINC_VERSION}/MiniZincIDE-${LATEST_MINIZINC_VERSION}-bundle-linux-x86_64.tgz" \
&& mkdir -p /opt/MiniZinc \
&& tar -xzf "MiniZincIDE-${LATEST_MINIZINC_VERSION}-bundle-linux-x86_64.tgz" -C /opt/MiniZinc --strip-components=1 \
&& rm "MiniZincIDE-${LATEST_MINIZINC_VERSION}-bundle-linux-x86_64.tgz"
# Create wrapper to set correct LD_LIBRARY_PATH at runtime
RUN echo '#!/bin/bash\nLD_LIBRARY_PATH=/opt/MiniZinc/lib:$LD_LIBRARY_PATH exec /opt/MiniZinc/bin/minizinc "$@"' \
> /usr/local/bin/minizinc \
&& chmod +x /usr/local/bin/minizinc
# Clone Autoguess
RUN git clone https://github.com/hadipourh/autoguess
WORKDIR /home/tools/autoguess
# Install SageMath
RUN apt-get install -y sagemath
# Install Graphviz
RUN apt-get install -y graphviz
# Create and activate a virtual environment
RUN python3 -m venv venv
# Install python-sat
RUN venv/bin/python3 -m pip install python-sat[pblib,aiger]
# Install pysmt
RUN venv/bin/python3 -m pip install pysmt
# Install smt solvers supported by pysmt
RUN venv/bin/python3 -m pip install cython
# RUN yes | venv/bin/python3 -m pysmt install --btor (Boolector has been archived, and its developers have officially stopped maintaining it.)
RUN yes | venv/bin/python3 -m pysmt install --z3
# Install Z3 solver
RUN venv/bin/python3 -m pip install z3-solver
# Install Python interface of MiniZinc
RUN venv/bin/python3 -m pip install minizinc
# Install Gurobi (Restricted license - for non-production use only)
RUN venv/bin/python3 -m pip install gurobipy
# Install Python interface of Graphviz
RUN venv/bin/python3 -m pip install graphviz
# Install dot2tex
RUN venv/bin/python3 -m pip install dot2tex
# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Set the default command to run when a container starts
CMD ["/bin/bash", "-c", "echo 'Docker image built successfully!'; cd /home/tools/autoguess && . venv/bin/activate && exec /bin/bash"]