From c5ff579706cdf790c5e2492d198e5bc8c2962852 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 29 Mar 2022 22:06:29 +0100 Subject: [PATCH] Use dotnet instead of mono and rebase to Alpine (#52) --- Dockerfile | 32 +++++++++++++------------------- Dockerfile.aarch64 | 27 ++++++++++++--------------- Dockerfile.armhf | 33 ++++++++++++++++++--------------- Jenkinsfile | 2 +- README.md | 2 ++ jenkins-vars.yml | 2 +- readme-vars.yml | 4 ++++ root/defaults/update.sh | 4 ++-- root/etc/cont-init.d/30-config | 5 +++++ root/etc/services.d/cron/run | 2 +- 10 files changed, 59 insertions(+), 54 deletions(-) mode change 100644 => 100755 root/defaults/update.sh diff --git a/Dockerfile b/Dockerfile index f40f76e..18ffce2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:focal +FROM ghcr.io/linuxserver/baseimage-alpine:3.15 # set version label ARG BUILD_DATE @@ -10,26 +10,22 @@ LABEL maintainer="saarg" ARG WEBGRAB_VER # environment variables. -ARG DEBIAN_FRONTEND="noninteractive" ENV HOME /config RUN \ - echo "**** add mono repository ****" && \ - apt-get update && \ - apt-get install -y \ - gnupg && \ - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ - echo "deb https://download.mono-project.com/repo/ubuntu focal main" | tee /etc/apt/sources.list.d/mono-official.list && \ echo "**** install packages ****" && \ - apt-get update && \ - apt-get install -y \ - cron \ - libmono-system-data4.0-cil \ - libmono-system-net-http-webrequest4.0-cil \ - libmono-system-web4.0-cil \ - mono-devel \ - mono-runtime \ + apk -U --update --no-cache add \ + bash \ + curl \ + icu-libs \ + iputils \ unzip && \ + echo "**** install dotnet sdk ****" && \ + mkdir -p /app/dotnet && \ + curl -o /tmp/dotnet-install.sh -L \ + https://dot.net/v1/dotnet-install.sh && \ + chmod +x /tmp/dotnet-install.sh && \ + /tmp/dotnet-install.sh -c 5.0 --install-dir /app/dotnet --runtime dotnet && \ echo "**** install webgrabplus ****" && \ if [ -z "$WEBGRAB_VER" ]; then \ WEBGRAB_VER=$(curl -fsL http://webgrabplus.com/download/sw | grep -m1 /download/sw/v | sed 's|.*/download/sw/v\(.*\)">V.*|\1|'); \ @@ -50,9 +46,7 @@ RUN \ unzip -q /tmp/ini.zip -d /defaults/ini/ && \ echo "**** cleanup ****" && \ rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* + /tmp/* # copy files COPY root/ / diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 1684cdd..bf07ece 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-focal +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.15 # set version label ARG BUILD_DATE @@ -14,22 +14,19 @@ ARG DEBIAN_FRONTEND="noninteractive" ENV HOME /config RUN \ - echo "**** add mono repository ****" && \ - apt-get update && \ - apt-get install -y \ - gnupg && \ - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ - echo "deb https://download.mono-project.com/repo/ubuntu focal main" | tee /etc/apt/sources.list.d/mono-official.list && \ echo "**** install packages ****" && \ - apt-get update && \ - apt-get install -y \ - cron \ - libmono-system-data4.0-cil \ - libmono-system-net-http-webrequest4.0-cil \ - libmono-system-web4.0-cil \ - mono-devel \ - mono-runtime \ + apk -U --update --no-cache add \ + bash \ + curl \ + icu-libs \ + iputils \ unzip && \ + echo "**** install dotnet sdk ****" && \ + mkdir -p /app/dotnet && \ + curl -o /tmp/dotnet-install.sh -L \ + https://dot.net/v1/dotnet-install.sh && \ + chmod +x /tmp/dotnet-install.sh && \ + /tmp/dotnet-install.sh -c 5.0 --install-dir /app/dotnet --runtime dotnet && \ echo "**** install webgrabplus ****" && \ if [ -z "$WEBGRAB_VER" ]; then \ WEBGRAB_VER=$(curl -fsL http://webgrabplus.com/download/sw | grep -m1 /download/sw/v | sed 's|.*/download/sw/v\(.*\)">V.*|\1|'); \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index fd0a37f..6e1bf46 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,10 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:arm32v7-focal +FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.15 + +# set version label +ARG BUILD_DATE +ARG VERSION +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="saarg" # package versions ARG WEBGRAB_VER @@ -8,22 +14,19 @@ ARG DEBIAN_FRONTEND="noninteractive" ENV HOME /config RUN \ - echo "**** add mono repository ****" && \ - apt-get update && \ - apt-get install -y \ - gnupg && \ - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ - echo "deb https://download.mono-project.com/repo/ubuntu focal main" | tee /etc/apt/sources.list.d/mono-official.list && \ echo "**** install packages ****" && \ - apt-get update && \ - apt-get install -y \ - cron \ - libmono-system-data4.0-cil \ - libmono-system-net-http-webrequest4.0-cil \ - libmono-system-web4.0-cil \ - mono-devel \ - mono-runtime \ + apk -U --update --no-cache add \ + bash \ + curl \ + icu-libs \ + iputils \ unzip && \ + echo "**** install dotnet sdk ****" && \ + mkdir -p /app/dotnet && \ + curl -o /tmp/dotnet-install.sh -L \ + https://dot.net/v1/dotnet-install.sh && \ + chmod +x /tmp/dotnet-install.sh && \ + /tmp/dotnet-install.sh -c 5.0 --install-dir /app/dotnet --runtime dotnet && \ echo "**** install webgrabplus ****" && \ if [ -z "$WEBGRAB_VER" ]; then \ WEBGRAB_VER=$(curl -fsL http://webgrabplus.com/download/sw | grep -m1 /download/sw/v | sed 's|.*/download/sw/v\(.*\)">V.*|\1|'); \ diff --git a/Jenkinsfile b/Jenkinsfile index 0a2a81a..0499fff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ pipeline { DOCKERHUB_IMAGE = 'linuxserver/webgrabplus' DEV_DOCKERHUB_IMAGE = 'lsiodev/webgrabplus' PR_DOCKERHUB_IMAGE = 'lspipepr/webgrabplus' - DIST_IMAGE = 'ubuntu' + DIST_IMAGE = 'alpine' MULTIARCH='true' CI='true' CI_WEB='false' diff --git a/README.md b/README.md index 6c4f9b3..e6579d8 100644 --- a/README.md +++ b/README.md @@ -246,6 +246,8 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **23.03.22:** - Rebase to Alpine 3.15. +* **23.03.22:** - Update to use dotnet instead of mono. * **06.01.22:** - Rebase to Ubuntu focal. Enable auto builds on version updates (beta and stable). * **17.12.21:** - Update to version 3.2.2 beta. * **05.08.21:** - Update to version 3.2.1 beta. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index eb15898..c08a8e7 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -15,7 +15,7 @@ repo_vars: - DOCKERHUB_IMAGE = 'linuxserver/webgrabplus' - DEV_DOCKERHUB_IMAGE = 'lsiodev/webgrabplus' - PR_DOCKERHUB_IMAGE = 'lspipepr/webgrabplus' - - DIST_IMAGE = 'ubuntu' + - DIST_IMAGE = 'alpine' - MULTIARCH='true' - CI='true' - CI_WEB='false' diff --git a/readme-vars.yml b/readme-vars.yml index 3207183..9c5a289 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -34,6 +34,8 @@ app_setup_block_enabled: true app_setup_block: | To configure WebGrab+Plus follow the [documentation](http://www.webgrabplus.com/documentation/configuration/) + **Please note that depending on your host this container may not work with the `no-new-privileges=true` security-opt.** + Note that there are some things in the guide that does not apply to this container. Below you can find the changes. **The configuration files are found where your config volume is mounted.** @@ -62,6 +64,8 @@ app_setup_block: | # changelog changelogs: + - { date: "23.03.22:", desc: "Rebase to Alpine 3.15." } + - { date: "23.03.22:", desc: "Update to use dotnet instead of mono." } - { date: "06.01.22:", desc: "Rebase to Ubuntu focal. Enable auto builds on version updates (beta and stable)." } - { date: "17.12.21:", desc: "Update to version 3.2.2 beta." } - { date: "05.08.21:", desc: "Update to version 3.2.1 beta." } diff --git a/root/defaults/update.sh b/root/defaults/update.sh old mode 100644 new mode 100755 index 693ee91..e09c183 --- a/root/defaults/update.sh +++ b/root/defaults/update.sh @@ -1,7 +1,7 @@ #!/bin/bash -cd /app/wg++/bin || exit +cd /app/wg++/bin.net || exit -mono WebGrab+Plus.exe "/config" +/app/dotnet/dotnet "WebGrab+Plus.dll" "/config" exit 0 diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index cb07fa6..eb07d5c 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -14,7 +14,12 @@ echo "******** Please use the file wg3-cron to adjust the scheduled time for run cp /defaults/wg3-cron /config/wg3-cron crontab -u abc /config/wg3-cron +mkdir -p /app/wg++/bin.net/WebGrab+Plus +mkdir -p /config/License +ln -sf /config/License /app/wg++/bin.net/WebGrab+Plus + # permissions chown -R abc:abc \ + /app \ /config \ /data diff --git a/root/etc/services.d/cron/run b/root/etc/services.d/cron/run index e25b352..ec46ba4 100644 --- a/root/etc/services.d/cron/run +++ b/root/etc/services.d/cron/run @@ -1,3 +1,3 @@ #!/usr/bin/with-contenv bash -exec /usr/sbin/cron -f -L 1 +exec /usr/sbin/crond -f -L 1