Skip to content

Commit 6a211e8

Browse files
authored
Dockerfile from Felipe's students
1 parent d162053 commit 6a211e8

File tree

1 file changed

+45
-14
lines changed

1 file changed

+45
-14
lines changed

asnets/Dockerfile

+45-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,45 @@
1-
FROM ubuntu:19.10
2-
RUN apt-get update -y && apt-get install -y python3-numpy python3-dev \
3-
python3-pip python3-wheel python3-venv flex bison build-essential \
4-
autoconf libtool git cmake libboost-all-dev
5-
RUN useradd -ms /bin/bash asnets
6-
COPY . /home/asnets/asnets
7-
RUN chown -R asnets:asnets /home/asnets/asnets
8-
USER asnets
9-
WORKDIR /home/asnets/asnets
10-
RUN python3 -m venv ${HOME}/venv-asnets
11-
RUN . ${HOME}/venv-asnets/bin/activate \
12-
&& echo . ${HOME}/venv-asnets/bin/activate >> ${HOME}/.bashrc \
13-
&& pip install --upgrade pip \
14-
&& pip install -e ${HOME}/asnets/
1+
# Dockerfile for asnets
2+
#
3+
# To build:
4+
# docker build -t asnets-bionic -f asnets-bionic.dockerfile .
5+
#
6+
# To run:
7+
# docker run -i --rm --mount type=bind,source=<full_path_to_shared_dir>,target=/home/asnets_user/shared -t asnets-bionic /bin/bash
8+
9+
# Base container.
10+
FROM ubuntu:bionic
11+
12+
# Install packages.
13+
RUN apt-get update \
14+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
15+
python3-numpy python3-dev python3-pip python3-wheel python3-venv flex \
16+
bison build-essential autoconf libtool git libboost-all-dev cmake \
17+
libhdf5-dev g++ git make
18+
19+
# Set up asnets user and group.
20+
RUN groupadd -g 999 asnets_user \
21+
&& useradd -r -u 999 -g asnets_user asnets_user \
22+
&& mkdir /home/asnets_user \
23+
&& chown -R asnets_user:asnets_user /home/asnets_user \
24+
&& adduser asnets_user sudo \
25+
&& echo "asnets ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
26+
27+
USER asnets_user
28+
29+
# Make sure LD_LIBRARY_PATH is set correctly to include /usr/local/lib.
30+
ENV LD_LIBRARY_PATH /usr/local/lib:/usr/local/lib/aarch64-linux-gnu:${LD_LIBRARY_PATH}
31+
32+
WORKDIR /home/asnets_user
33+
34+
# Install ASNets
35+
RUN git clone https://github.com/qxcv/asnets.git
36+
37+
RUN python3 -m venv venv-asnets && . venv-asnets/bin/activate \
38+
&& pip3 install --upgrade pip \
39+
&& pip3 install wheel cython numpy pkgconfig protobuf==3.19.6 werkzeug
40+
41+
RUN . venv-asnets/bin/activate && pip3 install -e asnets/asnets
42+
43+
RUN echo 'source ~/venv-asnets/bin/activate' >> ~/.bashrc
44+
45+
RUN echo 'ulimit -S -v 64000000' >> ~/.bashrc

0 commit comments

Comments
 (0)