Archived
2
0
This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
neko-custom/Dockerfile

120 lines
4.4 KiB
Docker
Raw Normal View History

2020-01-27 14:28:39 +13:00
FROM frolvlad/alpine-glibc
ENV GST_VERSION=1.16.2
# build gstreamer
RUN apk add --no-cache --virtual .gst-build-deps \
build-base bison flex perl python glib-dev zlib-dev \
opus-dev \
pulseaudio-dev libx11-dev libxv-dev libxt-dev libxfixes-dev libvpx-dev \
git nasm openssl-dev \
#
# build gstreamer
&& cd /tmp \
&& wget "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$GST_VERSION.tar.xz" \
&& tar xvfJ "gstreamer-$GST_VERSION.tar.xz" > /dev/null \
&& cd "gstreamer-$GST_VERSION" \
&& ./configure --prefix=/usr \
&& make && make install \
&& cd /tmp && rm -rf "gstreamer-$GST_VERSION" \
#
# build gst-plugins-base
&& wget "https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-$GST_VERSION.tar.xz" \
&& tar xvfJ "gst-plugins-base-$GST_VERSION.tar.xz" > /dev/null \
&& cd "gst-plugins-base-$GST_VERSION" \
&& ./configure --prefix=/usr \
&& make && make install \
&& cd /tmp && rm -rf "gst-plugins-base-$GST_VERSION" \
#
# build gst-plugins-good
&& wget "https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-$GST_VERSION.tar.xz" \
&& tar xvfJ "gst-plugins-good-$GST_VERSION.tar.xz" > /dev/null \
&& cd "gst-plugins-good-$GST_VERSION" \
&& ./configure --prefix=/usr \
&& make && make install \
&& cd /tmp && rm -rf "gst-plugins-good-$GST_VERSION" \
#
# build openh264
&& git clone https://github.com/cisco/openh264.git \
&& cd openh264 \
&& make && make install \
&& cd /tmp && rm -rf openh264 \
#
# build gst-plugins-bad
&& wget "https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-$GST_VERSION.tar.xz" \
&& tar xvfJ "gst-plugins-bad-$GST_VERSION.tar.xz" > /dev/null \
&& cd "gst-plugins-bad-$GST_VERSION" \
&& ./configure --prefix=/usr \
&& make && make install \
&& cd /tmp && rm -rf "gst-plugins-bad-$GST_VERSION" \
#
# remove build deps
&& apk del .gst-build-deps
2020-01-13 21:05:38 +13:00
ARG USERNAME=neko
ARG USER_UID=1000
ARG USER_GID=$USER_UID
2020-01-27 14:28:39 +13:00
# RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories
# RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
# RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
2020-01-13 21:05:38 +13:00
2020-01-27 14:28:39 +13:00
# install neko dependencies
RUN apk add --no-cache supervisor openbox dbus-x11 xvfb pulseaudio alsa-plugins-pulse opus libvpx libxv libxtst libxfixes xclip ttf-freefont \
&& apk add --no-cache libevent --repository "http://dl-cdn.alpinelinux.org/alpine/edge/main" \
&& apk add --no-cache firefox-esr --repository "http://dl-cdn.alpinelinux.org/alpine/edge/community" \
2020-01-13 21:05:38 +13:00
#
2020-01-27 14:28:39 +13:00
# create a non-root user
&& addgroup -g $USER_GID $USERNAME \
&& adduser -D -u $USER_UID -G $USERNAME -s /bin/ash -h /home/$USERNAME $USERNAME \
2020-01-13 21:05:38 +13:00
&& adduser $USERNAME audio \
&& adduser $USERNAME video \
&& adduser $USERNAME pulse \
#
2020-01-27 14:28:39 +13:00
# install uBlock
&& mkdir -p /usr/lib/firefox/distribution/extensions \
&& wget -O /usr/lib/firefox/distribution/extensions/uBlock0@raymondhill.net.xpi https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/addon-607454-latest.xpi \
2020-01-14 00:28:14 +13:00
#
2020-01-27 14:28:39 +13:00
# setup pulseaudio
2020-01-14 12:12:55 +13:00
&& mkdir -p /home/$USERNAME/.config/pulse/ \
2020-01-13 21:05:38 +13:00
&& echo "default-server=unix:/tmp/pulseaudio.socket" > /home/$USERNAME/.config/pulse/client.conf \
&& chown -R $USERNAME:$USERNAME /home/$USERNAME \
#
2020-01-27 14:28:39 +13:00
# workaround for an X11 problem: http://blog.tigerteufel.de/?p=476
2020-01-14 12:12:55 +13:00
&& mkdir /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix && chown $USERNAME /tmp/.X11-unix/ \
#
2020-01-27 14:28:39 +13:00
# make directories for neko
&& mkdir -p /etc/neko /var/www
#
# 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
COPY .docker/files/supervisord.conf /etc/neko/supervisord.conf
COPY .docker/files/default.pa /etc/pulse/default.pa
COPY .docker/files/firefox/neko.js /usr/lib/firefox/mozilla.cfg
COPY .docker/files/firefox/autoconfig.js /usr/lib/firefox/defaults/pref/autoconfig.js
COPY .docker/files/firefox/policies.json /usr/lib/firefox/distribution/policies.json
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"]