-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (62 loc) · 1.92 KB
/
Dockerfile
File metadata and controls
73 lines (62 loc) · 1.92 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
66
67
68
69
70
71
72
73
### Build image ###
FROM ubuntu:20.04 as build
ARG DEBIAN_FRONTEND=noninteractive
# install dependencies
RUN mkdir /agentsim-dev && \
mkdir /agentsim-dev/build && \
mkdir /agentsim-dev/lib && \
mkdir /agentsim-dev/agentsim && \
apt-get update && apt-get install -y \
build-essential \
cmake \
curl \
git \
openssl \
libblas-dev \
libhdf5-dev \
liblapack-dev \
python-dev \
libssl-dev libcurl4-openssl-dev \
libblosc1 \
libglew-dev mesa-common-dev freeglut3-dev
# copy agent sim project
COPY . /agentsim-dev/agentsim
WORKDIR /agentsim-dev/agentsim
# install submodules
RUN git submodule update --init --recursive
# build agentsim project
# ENABLE_UNITY_BUILD is for AWS CPP SDK. Turn it on for faster build but requires more memory to build.
RUN cd ../build && \
cmake ../agentsim -DBUILD_ONLY="s3;awstransfer;transfer" -DENABLE_UNITY_BUILD=OFF -DCMAKE_BUILD_TYPE=Release -DAUTORUN_UNIT_TESTS=OFF && \
make && \
openssl dhparam -out /dh.pem 2048 && \
find /agentsim-dev/build | grep -i so$ | xargs -i cp {} /agentsim-dev/lib/
### Run image ###
FROM ubuntu:20.04
WORKDIR /
# install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
libblas-dev \
libhdf5-dev \
liblapack-dev \
&& rm -rf /var/lib/apt/lists/*
# create non-root user
RUN groupadd -r app && useradd -r -g app app
# copy the server to the root dir
COPY --from=build --chown=app:app /agentsim-dev/build/agentsim_server.exe /usr/bin/agentsim_server.exe
COPY --from=build --chown=app:app /dh.pem /dh.pem
COPY --from=build --chown=app:app /agentsim-dev/build/bin/. /bin/
RUN echo " "
COPY --from=build --chown=app:app /agentsim-dev/lib/. /usr/lib/
RUN echo " "
COPY --from=build --chown=app:app /agentsim-dev/lib/. /usr/local/lib/
RUN echo " "
COPY --from=build --chown=app:app /usr/. /usr/
RUN echo " "
RUN mkdir /trajectory && chown -R app /trajectory
USER app
#expose port 9002 for server
EXPOSE 9002
CMD ["agentsim_server.exe"]