-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
69 lines (57 loc) · 1.88 KB
/
Dockerfile
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
66
67
68
69
# Start with a base Python 3.10 image from the Debian Buster distribution
FROM python:3.10-buster AS base
ARG BRANCH_NAME
# Switch to the root user and set the working directory to /root
USER root
WORKDIR /root
# Install required packages for building and running the software
RUN apt update \
&& apt install -y --no-install-recommends \
git \
build-essential \
libsuitesparse-dev \
libopenblas-dev \
libjansson-dev \
libssl-dev \
zlib1g-dev \
libev-dev \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install --upgrade pip
# Install the necessary Python packages
RUN python3 -m pip install \
kvxopt \
git+https://github.com/cuihantao/andes.git@develop \
--no-cache-dir
# Create a new user named 'cui' and a work directory
RUN useradd -ms /bin/bash cui && \
mkdir -p /home/cui/work
# Run selftest for the Andes package and move the config file to the new user's home directory
RUN python3 -m andes selftest && \
mv /root/.andes /home/cui && \
chown -R cui:cui /home/cui/.andes
# Build DiME 2 and install the Python client library
WORKDIR /tmp
RUN git clone https://github.com/CURENT/dime.git && \
cd dime/server && \
make clean && \
make && \
make install && \
cd ../client/python && \
python3 -m pip install . && \
cd ../../ && \
rm -rf dime \
&& rm -rf /tmp/dime
RUN git clone --single-branch --branch master https://github.com/CURENT/agvis.git && \
cd agvis && \
python3 -m pip install -e . && \
cd ..
# Switch to the 'cui' user and set the working directory to the new user's work directory
USER cui
WORKDIR /home/cui/work
# Copy the Andes config file to the new user's home directory
COPY andes.rc /home/cui/.andes
# Copy the current AGVis directory into the container.
COPY . .
# Set the entrypoint and command for the container
ENTRYPOINT []
CMD []