neko/apps/opera/Dockerfile
Miroslav Šedivý 552e6225cf fix opera build.
the latest release does not contain linux package, only mac. we need to swtch from taking the latest version to getting last 10 versions, looping through them and see which one actually has linux package.
2025-10-20 09:52:58 +02:00

44 lines
1.7 KiB
Docker

ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
FROM $BASE_IMAGE
ARG API_URL="https://download5.operacdn.com/pub/opera/desktop/"
ARG LIBFFMPEG_API_URL="https://api.github.com/repos/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/latest"
#
# install opera
RUN set -eux; apt-get update; \
#
# fetch latest available release with linux package
VERSIONS="$(wget -O - "${API_URL}" 2>/dev/null | sed -n 's/.*href="\([^"/]*\).*/\1/p' | sort --version-sort -r | head -n 10)"; \
VERSION=""; \
for v in $VERSIONS; do \
if wget --spider "${API_URL}${v}/linux/opera-stable_${v}_amd64.deb" 2>/dev/null; then \
VERSION="$v"; \
break; \
fi; \
done; \
if [ -z "$VERSION" ]; then \
echo "No Opera version with Linux package found"; \
exit 1; \
fi; \
echo "Using Opera version: $VERSION"; \
wget -O /tmp/opera.deb "${API_URL}${VERSION}/linux/opera-stable_${VERSION}_amd64.deb"; \
apt-get install -y --no-install-recommends openbox jq unzip /tmp/opera.deb; \
#
# install libffmpeg
LIBFFMPEG_URL="$(wget -O - "${LIBFFMPEG_API_URL}" 2>/dev/null | jq -r "[.assets[] | select(.browser_download_url | contains(\"linux-x64.zip\"))][-1] | .browser_download_url")"; \
wget -O /tmp/libffmpeg.zip $LIBFFMPEG_URL; \
unzip -o /tmp/libffmpeg.zip libffmpeg.so -d /usr/lib/x86_64-linux-gnu/opera/lib_extra; \
echo '[]' > /usr/lib/x86_64-linux-gnu/opera/resources/ffmpeg_preload_config.json; \
#
# clean up
apt-get --purge autoremove -y unzip jq; \
apt-get clean -y; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#
# copy configuation files
COPY supervisord.conf /etc/neko/supervisord/opera.conf
COPY openbox.xml /etc/neko/openbox.xml