Skip to content

Commit

Permalink
Merge pull request #56 from linuxserver/noble-rebase
Browse files Browse the repository at this point in the history
Noble rebase
  • Loading branch information
aptalca authored Sep 26, 2024
2 parents fe64dc9 + 511e01b commit 34472ad
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 68 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/external_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ jobs:
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
echo "> External trigger running off of master branch. To disable this trigger, set a Github secret named \`PAUSE_EXTERNAL_TRIGGER_FIREFOX_MASTER\`" >> $GITHUB_STEP_SUMMARY
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:'"firefox"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
echo "Type is \`alpine_repo\`" >> $GITHUB_STEP_SUMMARY
EXT_RELEASE=$(curl -s -L https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/dists/noble/main/binary-amd64/Packages.gz | gunzip |grep -A 7 -m 1 'Package: firefox' | awk -F ': ' '/Version/{print $2;exit}' | sed 's|[+~,]||g')
echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Can't retrieve external version, exiting" >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -75,13 +74,6 @@ jobs:
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
echo "Version \`${EXT_RELEASE}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
exit 0
elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/community/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"firefox"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
echo "New version \`${EXT_RELEASE}\` found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY
FAILURE_REASON="New version ${EXT_RELEASE} for firefox tag latest is detected, however not all arch repos are updated yet. Will try again later."
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
exit 0
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-firefox/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY
exit 0
Expand Down
34 changes: 14 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-kasmvnc:alpine320
FROM ghcr.io/linuxserver/baseimage-kasmvnc:ubuntunoble

# set version label
ARG BUILD_DATE
Expand All @@ -10,31 +10,25 @@ LABEL maintainer="thelamer"
# title
ENV TITLE=Firefox

# prevent Ubuntu's firefox stub from being installed
COPY /root/etc/apt/preferences.d/firefox-no-snap /etc/apt/preferences.d/firefox-no-snap

RUN \
echo "**** add icon ****" && \
curl -o \
/kclient/public/icon.png \
https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/firefox-logo.png && \
echo "**** install packages ****" && \
if [ -z ${FIREFOX_VERSION+x} ]; then \
FIREFOX_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:firefox$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add --no-cache \
firefox==${FIREFOX_VERSION} && \
echo "**** lang support ****" && \
FF_VERSION=$(curl -sI https://download.mozilla.org/?product=firefox-latest | awk -F '(releases/|/win32)' '/Location/ {print $2}') && \
REL_URL="https://releases.mozilla.org/pub/firefox/releases/${FF_VERSION}/win64/xpi/" && \
LANGS=$(curl -Ls ${REL_URL} | awk -F '(xpi">|</a>)' '/href.*xpi/ {print $2}' | tr '\n' ' ') && \
EXT_DIR=/usr/lib/firefox/distribution/extensions/ && \
mkdir -p ${EXT_DIR} && \
for LANG in ${LANGS}; do \
LANGCODE=$(echo ${LANG} | sed 's/\.xpi//g'); \
echo "Downloading ${LANG} Language pack"; \
curl -o \
${EXT_DIR}langpack-${LANGCODE}@firefox.mozilla.org.xpi -Ls \
${REL_URL}${LANG};\
done && \
apt-key adv \
--keyserver hkp://keyserver.ubuntu.com:80 \
--recv-keys 738BEB9321D1AAEC13EA9391AEBDF4819BE21867 && \
echo \
"deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu noble main" > \
/etc/apt/sources.list.d/firefox.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
firefox \
^firefox-locale && \
echo "**** default firefox settings ****" && \
FIREFOX_SETTING="/usr/lib/firefox/browser/defaults/preferences/firefox.js" && \
echo 'pref("datareporting.policy.firstRunURL", "");' > ${FIREFOX_SETTING} && \
Expand Down
34 changes: 14 additions & 20 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-kasmvnc:arm64v8-alpine320
FROM ghcr.io/linuxserver/baseimage-kasmvnc:arm64v8-ubuntunoble

# set version label
ARG BUILD_DATE
Expand All @@ -10,31 +10,25 @@ LABEL maintainer="thelamer"
# title
ENV TITLE=Firefox

# prevent Ubuntu's firefox stub from being installed
COPY /root/etc/apt/preferences.d/firefox-no-snap /etc/apt/preferences.d/firefox-no-snap

RUN \
echo "**** add icon ****" && \
curl -o \
/kclient/public/icon.png \
https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/firefox-logo.png && \
echo "**** install packages ****" && \
if [ -z ${FIREFOX_VERSION+x} ]; then \
FIREFOX_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:firefox$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add --no-cache \
firefox==${FIREFOX_VERSION} && \
echo "**** lang support ****" && \
FF_VERSION=$(curl -sI https://download.mozilla.org/?product=firefox-latest | awk -F '(releases/|/win32)' '/Location/ {print $2}') && \
REL_URL="https://releases.mozilla.org/pub/firefox/releases/${FF_VERSION}/win64/xpi/" && \
LANGS=$(curl -Ls ${REL_URL} | awk -F '(xpi">|</a>)' '/href.*xpi/ {print $2}' | tr '\n' ' ') && \
EXT_DIR=/usr/lib/firefox/distribution/extensions/ && \
mkdir -p ${EXT_DIR} && \
for LANG in ${LANGS}; do \
LANGCODE=$(echo ${LANG} | sed 's/\.xpi//g'); \
echo "Downloading ${LANG} Language pack"; \
curl -o \
${EXT_DIR}langpack-${LANGCODE}@firefox.mozilla.org.xpi -Ls \
${REL_URL}${LANG};\
done && \
apt-key adv \
--keyserver hkp://keyserver.ubuntu.com:80 \
--recv-keys 738BEB9321D1AAEC13EA9391AEBDF4819BE21867 && \
echo \
"deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu noble main" > \
/etc/apt/sources.list.d/firefox.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
firefox \
^firefox-locale && \
echo "**** default firefox settings ****" && \
FIREFOX_SETTING="/usr/lib/firefox/browser/defaults/preferences/firefox.js" && \
echo 'pref("datareporting.policy.firstRunURL", "");' > ${FIREFOX_SETTING} && \
Expand Down
18 changes: 7 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ pipeline {
DOCKERHUB_IMAGE = 'linuxserver/firefox'
DEV_DOCKERHUB_IMAGE = 'lsiodev/firefox'
PR_DOCKERHUB_IMAGE = 'lspipepr/firefox'
DIST_IMAGE = 'alpine'
DIST_TAG = '3.20'
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.20/community/'
DIST_REPO_PACKAGES = 'firefox'
DIST_IMAGE = 'ubuntu'
MULTIARCH = 'true'
CI = 'true'
CI_WEB = 'true'
Expand Down Expand Up @@ -129,15 +126,14 @@ pipeline {
/* ########################
External Release Tagging
######################## */
// If this is an alpine repo change for external version determine an md5 from the version string
stage("Set tag Alpine Repo"){
// If this is a custom command to determine version use that command
stage("Set tag custom bash"){
steps{
script{
env.EXT_RELEASE = sh(
script: '''curl -sL "${DIST_REPO}x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:'"${DIST_REPO_PACKAGES}"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://' ''',
script: ''' curl -s -L https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/dists/noble/main/binary-amd64/Packages.gz | gunzip |grep -A 7 -m 1 'Package: firefox' | awk -F ': ' '/Version/{print $2;exit}' | sed 's|[+~,]||g' ''',
returnStdout: true).trim()
env.RELEASE_LINK = 'alpine_repo'
env.RELEASE_LINK = 'custom_command'
}
}
}
Expand Down Expand Up @@ -874,11 +870,11 @@ pipeline {
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
echo "Pushing New release for Tag"
sh '''#! /bin/bash
echo "Updating external repo packages to ${EXT_RELEASE_CLEAN}" > releasebody.json
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
echo '{"tag_name":"'${META_TAG}'",\
"target_commitish": "master",\
"name": "'${META_TAG}'",\
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**Repo Changes:**\\n\\n' > start
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**Remote Changes:**\\n\\n' > start
printf '","draft": false,"prerelease": false}' >> releasebody.json
paste -d'\\0' start releasebody.json > releasebody.json.done
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
Expand Down
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,43 @@ To install cjk fonts on startup as an example pass the environment variables:

```
-e DOCKER_MODS=linuxserver/mods:universal-package-install
-e INSTALL_PACKAGES=font-noto-cjk
-e INSTALL_PACKAGES=fonts-noto-cjk
-e LC_ALL=zh_CN.UTF-8
```

The web interface has the option for "IME Input Mode" in Settings which will allow non english characters to be used from a non en_US keyboard on the client. Once enabled it will perform the same as a local Linux installation set to your locale.

### Nvidia GPU Support

Nvidia support is available by leveraging Zink for OpenGL support. This can be enabled with the following run flags:

| Variable | Description |
| :----: | --- |
| --gpus all | This can be filtered down but for most setups this will pass the one Nvidia GPU on the system |
| --runtime nvidia | Specify the Nvidia runtime which mounts drivers and tools in from the host |

The compose syntax is slightly different for this as you will need to set nvidia as the default runtime:

```
sudo nvidia-ctk runtime configure --runtime=docker --set-as-default
sudo service docker restart
```

And to assign the GPU in compose:

```
services:
firefox:
image: linuxserver/firefox:latest
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [compute,video,graphics,utility]
```

### Lossless mode

This container is capable of delivering a true lossless image at a high framerate to your web browser by changing the Stream Quality preset to "Lossless", more information [here](https://www.kasmweb.com/docs/latest/how_to/lossless.html#technical-background). In order to use this mode from a non localhost endpoint the HTTPS port on 3001 needs to be used. If using a reverse proxy to port 3000 specific headers will need to be set as outlined [here](https://github.com/linuxserver/docker-baseimage-kasmvnc#lossless).
Expand Down Expand Up @@ -334,6 +365,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **25.09.24:** - Rebase to Ubuntu Noble.
* **23.05.24:** - Rebase to Alpine 3.20.
* **13.02.24:** - Add ability to pass CLI args to Firefox.
* **10.02.24:** - Update Readme with new env vars and ingest proper PWA icon.
Expand Down
8 changes: 3 additions & 5 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# jenkins variables
project_name: docker-firefox
external_type: alpine_repo
external_type: na
custom_version_command: "curl -s -L https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/dists/noble/main/binary-amd64/Packages.gz | gunzip |grep -A 7 -m 1 'Package: firefox' | awk -F ': ' '/Version/{print $2;exit}' | sed 's|[+~,]||g'"
release_type: stable
release_tag: latest
ls_branch: master
Expand All @@ -15,10 +16,7 @@ repo_vars:
- DOCKERHUB_IMAGE = 'linuxserver/firefox'
- DEV_DOCKERHUB_IMAGE = 'lsiodev/firefox'
- PR_DOCKERHUB_IMAGE = 'lspipepr/firefox'
- DIST_IMAGE = 'alpine'
- DIST_TAG = '3.20'
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.20/community/'
- DIST_REPO_PACKAGES = 'firefox'
- DIST_IMAGE = 'ubuntu'
- MULTIARCH = 'true'
- CI = 'true'
- CI_WEB = 'true'
Expand Down
34 changes: 33 additions & 1 deletion readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,50 @@ app_setup_block: |
```
-e DOCKER_MODS=linuxserver/mods:universal-package-install
-e INSTALL_PACKAGES=font-noto-cjk
-e INSTALL_PACKAGES=fonts-noto-cjk
-e LC_ALL=zh_CN.UTF-8
```
The web interface has the option for "IME Input Mode" in Settings which will allow non english characters to be used from a non en_US keyboard on the client. Once enabled it will perform the same as a local Linux installation set to your locale.
### Nvidia GPU Support
Nvidia support is available by leveraging Zink for OpenGL support. This can be enabled with the following run flags:
| Variable | Description |
| :----: | --- |
| --gpus all | This can be filtered down but for most setups this will pass the one Nvidia GPU on the system |
| --runtime nvidia | Specify the Nvidia runtime which mounts drivers and tools in from the host |
The compose syntax is slightly different for this as you will need to set nvidia as the default runtime:
```
sudo nvidia-ctk runtime configure --runtime=docker --set-as-default
sudo service docker restart
```
And to assign the GPU in compose:
```
services:
firefox:
image: linuxserver/firefox:latest
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [compute,video,graphics,utility]
```
### Lossless mode
This container is capable of delivering a true lossless image at a high framerate to your web browser by changing the Stream Quality preset to "Lossless", more information [here](https://www.kasmweb.com/docs/latest/how_to/lossless.html#technical-background). In order to use this mode from a non localhost endpoint the HTTPS port on 3001 needs to be used. If using a reverse proxy to port 3000 specific headers will need to be set as outlined [here](https://github.com/linuxserver/docker-baseimage-kasmvnc#lossless).
# changelog
changelogs:
- { date: "25.09.24:", desc: "Rebase to Ubuntu Noble." }
- { date: "23.05.24:", desc: "Rebase to Alpine 3.20." }
- { date: "13.02.24:", desc: "Add ability to pass CLI args to Firefox." }
- { date: "10.02.24:", desc: "Update Readme with new env vars and ingest proper PWA icon." }
Expand Down
3 changes: 3 additions & 0 deletions root/etc/apt/preferences.d/firefox-no-snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Package: firefox*
Pin: release o=Ubuntu*
Pin-Priority: -1

0 comments on commit 34472ad

Please sign in to comment.