neko/Dockerfile

95 lines
2.7 KiB
Docker
Raw Normal View History

2020-01-28 20:07:35 +13:00
FROM debian:stretch-slim
2020-01-27 14:28:39 +13:00
2020-02-03 11:48:23 +13:00
#
2020-01-28 20:07:35 +13:00
# avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
2020-01-13 21:05:38 +13:00
ARG USERNAME=neko
ARG USER_UID=1000
ARG USER_GID=$USER_UID
2020-02-03 11:48:23 +13:00
#
# install libclipboard
RUN set -eux; apt-get update; \
apt-get install -y --no-install-recommends ca-certificates git cmake pkg-config build-essential libx11-dev ; \
cd /tmp ; \
git clone https://github.com/jtanx/libclipboard ; \
cd libclipboard ; \
cmake -DBUILD_SHARED_LIBS=ON -DLIBCLIPBOARD_FORCE_X11=on -DLIBCLIPBOARD_ADD_SOVERSION=ON --prefix=/usr/local . ; \
make -j4; \
make install; \
rm -rf /tmp/libclipboard ; \
#
# clean up
apt-get autoremove -y git cmake pkg-config build-essential libx11-dev; \
apt-get clean -y; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#
2020-01-27 14:28:39 +13:00
# install neko dependencies
2020-01-30 20:19:57 +13:00
RUN set -eux; apt-get update; \
2020-02-03 11:48:23 +13:00
apt-get install -y --no-install-recommends wget ca-certificates pulseaudio openbox dbus-x11 xvfb supervisor; \
2020-01-30 20:19:57 +13:00
apt-get install -y --no-install-recommends libxv1 libopus0 libvpx4; \
2020-01-13 21:05:38 +13:00
#
2020-01-27 14:28:39 +13:00
# create a non-root user
2020-01-30 20:19:57 +13:00
groupadd --gid $USER_GID $USERNAME; \
useradd --uid $USER_UID --gid $USERNAME --shell /bin/bash --create-home $USERNAME; \
adduser $USERNAME audio; \
adduser $USERNAME video; \
adduser $USERNAME pulse; \
2020-01-14 00:28:14 +13:00
#
2020-01-27 14:28:39 +13:00
# setup pulseaudio
2020-01-30 20:19:57 +13:00
mkdir -p /home/$USERNAME/.config/pulse/; \
echo "default-server=unix:/tmp/pulseaudio.socket" > /home/$USERNAME/.config/pulse/client.conf; \
2020-01-13 21:05:38 +13:00
#
2020-01-27 14:28:39 +13:00
# workaround for an X11 problem: http://blog.tigerteufel.de/?p=476
2020-01-30 20:19:57 +13:00
mkdir /tmp/.X11-unix; chmod 1777 /tmp/.X11-unix; chown $USERNAME /tmp/.X11-unix/; \
2020-01-14 12:12:55 +13:00
#
2020-01-27 14:28:39 +13:00
# make directories for neko
2020-01-30 20:19:57 +13:00
mkdir -p /etc/neko /var/www /var/log/neko; chmod 1777 /var/log/neko; chown $USERNAME /var/log/neko/; \
chown -R $USERNAME:$USERNAME /home/$USERNAME; \
2020-01-28 20:07:35 +13:00
#
# clean up
2020-01-30 20:19:57 +13:00
apt-get clean -y; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
2020-02-03 11:48:23 +13:00
#
2020-01-30 20:19:57 +13:00
# add gst to env
ENV PATH=/gst/local/bin:$PATH
ENV LD_LIBRARY_PATH=/gst/local/lib:$LD_LIBRARY_PATH
ENV PKG_CONFIG_PATH=/gst/local/lib/pkgconfig:$PKG_CONFIG_PATH
2020-02-03 11:48:23 +13:00
#
2020-01-30 20:19:57 +13:00
# copy gst
COPY .build/gst/local /gst/local/
2020-01-27 14:28:39 +13:00
#
# env
ENV USER=$USERNAME
ENV SCREEN_WIDTH=1280
ENV SCREEN_HEIGHT=720
ENV SCREEN_DEPTH=24
ENV DISPLAY=:99.0
2020-01-13 21:05:38 +13:00
#
2020-01-27 14:28:39 +13:00
# copy configuation files
COPY .docker/files/dbus /usr/bin/dbus
COPY .docker/files/openbox.xml /etc/neko/openbox.xml
2020-01-30 20:19:57 +13:00
COPY .docker/files/neko/supervisord.conf /etc/neko/supervisord/neko.conf
2020-01-27 14:28:39 +13:00
COPY .docker/files/supervisord.conf /etc/neko/supervisord.conf
COPY .docker/files/default.pa /etc/pulse/default.pa
2020-01-13 21:05:38 +13:00
#
2020-01-27 14:28:39 +13:00
# neko files
2020-01-13 21:05:38 +13:00
COPY client/dist/ /var/www
COPY server/bin/neko /usr/bin/neko
#
2020-01-27 14:28:39 +13:00
# neko env
2020-01-13 21:05:38 +13:00
ENV NEKO_PASSWORD=neko
2020-01-24 06:29:20 +13:00
ENV NEKO_ADMIN=admin
2020-01-14 12:12:55 +13:00
ENV NEKO_BIND=:8080
2020-01-13 21:05:38 +13:00
#
2020-01-27 14:28:39 +13:00
# run neko
CMD ["/usr/bin/supervisord", "-c", "/etc/neko/supervisord.conf"]