docker-firefox/Dockerfile
2018-02-14 20:50:50 -05:00

90 lines
2.7 KiB
Docker

#
# firefox Dockerfile
#
# https://github.com/jlesage/docker-firefox
#
# Pull base image.
FROM jlesage/baseimage-gui:alpine-3.7-v3.3.2
# Define software versions.
ARG FIREFOX_VERSION=58.0.1-r1
#ARG PROFILE_CLEANER_VERSION=2.36
# Define software download URLs.
#ARG PROFILE_CLEANER_URL=https://github.com/graysky2/profile-cleaner/raw/v${PROFILE_CLEANER_VERSION}/common/profile-cleaner.in
# Define working directory.
WORKDIR /tmp
# Install Firefox.
RUN \
add-pkg firefox=${FIREFOX_VERSION} --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing && \
add-pkg \
desktop-file-utils \
adwaita-icon-theme \
ttf-dejavu
# Set default settings.
RUN \
CFG_FILE="$(ls /usr/lib/firefox-*/browser/defaults/preferences/firefox-branding.js)" && \
echo '' >> "$CFG_FILE" && \
echo '// Default download directory.' >> "$CFG_FILE" && \
echo 'pref("browser.download.dir", "/config/downloads");' >> "$CFG_FILE" && \
echo 'pref("browser.download.folderList", 2);' >> "$CFG_FILE"
# Install profile-cleaner.
#RUN \
# add-pkg --virtual build-dependencies curl && \
# curl -# -L -o /usr/bin/profile-cleaner {$PROFILE_CLEANER_URL} && \
# sed-patch 's/@VERSION@/'${PROFILE_CLEANER_VERSION}'/' /usr/bin/profile-cleaner && \
# chmod +x /usr/bin/profile-cleaner && \
# add-pkg \
# bash \
# file \
# coreutils \
# bc \
# parallel \
# sqlite \
# && \
# # Cleanup.
# del-pkg build-dependencies && \
# rm -rf /tmp/* /tmp/.[!.]*
# Enable log monitoring.
RUN \
add-pkg yad && \
sed-patch 's|LOG_FILES=|LOG_FILES=/config/log/firefox/error.log|' /etc/logmonitor/logmonitor.conf && \
sed-patch 's|STATUS_FILES=|STATUS_FILES=/tmp/.firefox_shm_check|' /etc/logmonitor/logmonitor.conf
# Adjust the openbox config.
RUN \
# Maximize only the main window.
sed-patch 's/<application type="normal">/<application type="normal" title="Mozilla Firefox">/' \
/etc/xdg/openbox/rc.xml && \
# Make sure the main window is always in the background.
sed-patch '/<application type="normal" title="Mozilla Firefox">/a \ <layer>below</layer>' \
/etc/xdg/openbox/rc.xml
# Generate and install favicons.
RUN \
APP_ICON_URL=https://github.com/jlesage/docker-templates/raw/master/jlesage/images/firefox-icon.png && \
install_app_icon.sh "$APP_ICON_URL"
# Add files.
COPY rootfs/ /
# Set environment variables.
ENV APP_NAME="Firefox"
# Define mountable directories.
VOLUME ["/config"]
# Metadata.
LABEL \
org.label-schema.name="firefox" \
org.label-schema.description="Docker container for Firefox" \
org.label-schema.version="unknown" \
org.label-schema.vcs-url="https://github.com/jlesage/docker-firefox" \
org.label-schema.schema-version="1.0"