Skip to content

Commit 1526841

Browse files
committed
dockerfile wip
1 parent f5936fb commit 1526841

File tree

5 files changed

+95
-16
lines changed

5 files changed

+95
-16
lines changed

Dockerfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

docker/Dockerfile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
FROM ubuntu:20.04
2+
3+
RUN export DEBIAN_FRONTEND=noninteractive \
4+
&& apt-get update \
5+
&& apt-get -y install swig python3-wxgtk4.0 python3-pip python3-minimal x11-xserver-utils wget qtbase5-dev libsdl2-2.0-0 libusb-1.0-0-dev portaudio19-dev libasound2-dev pulseaudio\
6+
&& apt-get -y install pkg-config git cmake build-essential nasm wget python3-setuptools libusb-1.0-0-dev python3-dev python3-pip python3-numpy python3-scipy libglew-dev libtbb-dev \
7+
libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libavresample-dev ffmpeg x264 x265 libportaudio2 portaudio19-dev \
8+
python3-opencv libopencv-dev libeigen3-dev \
9+
&& apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/*
10+
11+
RUN wget -O libjpeg-turbo.tar.gz https://sourceforge.net/projects/libjpeg-turbo/files/1.5.1/libjpeg-turbo-1.5.1.tar.gz/download \
12+
&& tar xvzf libjpeg-turbo.tar.gz \
13+
&& cd libjpeg-turbo-1.5.1 \
14+
&& ./configure --enable-static=no --prefix=/usr/local \
15+
&& make install \
16+
&& ldconfig
17+
18+
RUN git clone https://github.com/pupil-labs/libuvc \
19+
&& cd libuvc \
20+
&& mkdir build \
21+
&& cd build \
22+
&& cmake .. \
23+
&& make && make install
24+
25+
RUN mkdir /src/ && cd /src \
26+
&& wget https://github.com/courtois-neuromod/pupil/archive/refs/heads/testing.zip \
27+
&& unzip testing.zip \
28+
&& mv pupil-testing pupil \
29+
&& cd pupil \
30+
&& pip install -r requirements.txt
31+
32+
RUN export DEBIAN_FRONTEND=noninteractive \
33+
&& apt-get update \
34+
&& apt-get -y install libpulse-dev \
35+
&& apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/*
36+
37+
ARG ARAVIS_VERSION=0.8.21
38+
39+
RUN export DEBIAN_FRONTEND=noninteractive \
40+
&& apt-get update \
41+
&& apt-get -y install libxml2-dev libglib2.0-dev cmake libusb-1.0-0-dev gobject-introspection \
42+
libgtk-3-dev gtk-doc-tools xsltproc libgstreamer1.0-dev \
43+
libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev \
44+
libgirepository1.0-dev ninja-build\
45+
&& apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/*
46+
47+
RUN pip3 install --upgrade meson numpy scipy
48+
49+
RUN cd /src/ \
50+
&& wget https://github.com/AravisProject/aravis/archive/refs/tags/${ARAVIS_VERSION}.tar.gz \
51+
&& tar -xzf ${ARAVIS_VERSION}.tar.gz \
52+
&& cd aravis-$ARAVIS_VERSION \
53+
&& meson build && cd build \
54+
&& ninja && ninja install
55+
56+
RUN cd /src/ \
57+
&& wget https://github.com/courtois-neuromod/task_stimuli/archive/refs/heads/eyetracker_desktop.zip \
58+
&& unzip eyetracker_desktop.zip \
59+
&& mv task_stimuli-* task_stimuli
60+
RUN pip3 install -r /src/task_stimuli/requirements.txt
61+
62+
RUN export DEBIAN_FRONTEND=noninteractive \
63+
&& apt-get update \
64+
&& apt-get -y install gosu\
65+
&& apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/*
66+
67+
RUN pip3 install ipython
68+
69+
COPY ./entrypoint.sh /entrypoint.sh
70+
RUN chmod +x /entrypoint.sh
71+
72+
COPY pulse-client.conf /etc/pulse/client.conf
73+
74+
ENTRYPOINT ["/entrypoint.sh"]

docker/entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
USERNAME=user
4+
HOST_UID=${HOST_UID:?set HOST_UID}
5+
HOST_UID=${HOST_GID:?set HOST_GID}
6+
7+
useradd -u "${HOST_UID}" -o -m "${USERNAME}"
8+
groupmod -g "${HOST_GID}" "${USERNAME}"
9+
10+
cd /src/task_stimuli/
11+
gosu $USERNAME /usr/bin/python3 /src/task_stimuli/main.py $@

docker/pulse-client.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Connect to the host's server using the mounted UNIX socket
2+
default-server = unix:/run/user/1000/pulse/native
3+
4+
# Prevent a server running in the container
5+
autospawn = no
6+
daemon-binary = /bin/true
7+
8+
# Prevent the use of shared memory
9+
enable-shm = false

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pandas>=1.1.1
44
python-dotenv
55
tqdm>=4.60.0
66
textdistance
7+
colorama

0 commit comments

Comments
 (0)