back to debian, better firefox support

This commit is contained in:
Craig
2020-01-28 07:07:35 +00:00
parent e4a554830d
commit 56464778f2
13 changed files with 251 additions and 210 deletions

View File

@ -1,79 +1,70 @@
FROM frolvlad/alpine-glibc
FROM debian:stretch-slim
ENV GST_VERSION=1.16.2
# avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
ENV GSTPATH /gst
ENV GST_VERSION 1.16
# 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" \
RUN set -eux && \
apt-get update && apt-get install -y --no-install-recommends \
git ca-certificates build-essential perl python pkg-config autoconf automake autopoint libtool bison flex \
gettext nasm openssl libglib2.0-dev libopus-dev libvpx-dev libpulse-dev libx11-dev libxv-dev libxt-dev \
libxtst-dev libxfixes-dev libssl-dev \
## set up dir
&& mkdir $GSTPATH \
#
# build openh264
&& cd $GSTPATH \
&& git clone https://github.com/cisco/openh264.git \
&& cd openh264 \
&& make && make install \
&& cd /tmp && rm -rf openh264 \
&& cd $GSTPATH && 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" \
# build gstreamer
&& for MODULE in \
gstreamer \
gst-plugins-base \
gst-plugins-good \
gst-plugins-bad \
; do \
git clone git://anongit.freedesktop.org/gstreamer/$MODULE; \
cd $MODULE; \
git checkout $GST_VERSION; \
PATH=$GSTPATH/local/bin:$PATH PKG_CONFIG_PATH=$GSTPATH/local/lib/pkgconfig ./autogen.sh --prefix $GSTPATH/local --disable-gtk-doc; \
make && make install; \
cd $GSTPATH && rm -rf $MODULE; \
done \
#
# remove build deps
&& apk del .gst-build-deps
&& apt-get --purge autoremove -y build-essential perl python pkg-config autoconf automake autopoint libtool bison flex \
gettext nasm openssl libglib2.0-dev libopus-dev libvpx-dev libpulse-dev libx11-dev libxv-dev libxt-dev \
libxtst-dev libxfixes-dev libssl-dev
ENV PATH=$GSTPATH/local/bin:$PATH
ENV LD_LIBRARY_PATH=$GSTPATH/local/lib:$LD_LIBRARY_PATH
ENV PKG_CONFIG_PATH=$GSTPATH/local/lib/pkgconfig:$PKG_CONFIG_PATH
ARG USERNAME=neko
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# 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
# 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" \
RUN set -eux \
&& apt-get update && apt-get install -y --no-install-recommends wget ca-certificates pulseaudio openbox dbus-x11 xvfb libxv1 xclip firefox-esr supervisor \
#
# create a non-root user
&& addgroup -g $USER_GID $USERNAME \
&& adduser -D -u $USER_UID -G $USERNAME -s /bin/ash -h /home/$USERNAME $USERNAME \
&& 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 \
#
# 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 \
# install extensions
&& mkdir -p /usr/lib/firefox-esr/distribution/extensions \
&& wget -O /usr/lib/firefox-esr/distribution/extensions/uBlock0@raymondhill.net.xpi https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi \
&& wget -O /usr/lib/firefox-esr/distribution/extensions/nordvpnproxy@nordvpn.com.xpi https://addons.mozilla.org/firefox/downloads/latest/nordvpn-proxy-extension/latest.xpi \
#
# setup pulseaudio
&& mkdir -p /home/$USERNAME/.config/pulse/ \
@ -84,7 +75,12 @@ RUN apk add --no-cache supervisor openbox dbus-x11 xvfb pulseaudio alsa-plugins-
&& mkdir /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix && chown $USERNAME /tmp/.X11-unix/ \
#
# make directories for neko
&& mkdir -p /etc/neko /var/www
&& mkdir -p /etc/neko /var/www \
#
# clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#
# env
@ -100,9 +96,9 @@ 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
COPY .docker/files/firefox/neko.js /usr/lib/firefox-esr/mozilla.cfg
COPY .docker/files/firefox/autoconfig.js /usr/lib/firefox-esr/defaults/pref/autoconfig.js
COPY .docker/files/firefox/policies.json /usr/lib/firefox-esr/distribution/policies.json
#
# neko files