diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc0f35a..e958473 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,15 +11,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Installing dependencies run: | sudo apt update && sudo apt install make -y - git clone https://github.com/estesp/manifest-tool && cd manifest-tool && git checkout v0.9.0 && sudo make && sudo make install && cd .. && rm -Rf manifest-tool - docker run --rm --privileged multiarch/qemu-user-static:register - sudo apt install -y qemu qemu-user-static qemu-user binfmt-support echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_LOGIN }}" --password-stdin - echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin + - name: install buildx + id: buildx + uses: crazy-max/ghaction-docker-buildx@v1 - name: Build image run: make build - name: Publish image diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9e3ac02..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -qemu-*-static -*.yaml -.Dockerfile diff --git a/Dockerfile b/Dockerfile index 7032b72..5fe10d1 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,16 @@ -FROM openjdk:jre-alpine as builder +FROM bellsoft/liberica-openjdk-alpine:10.0.2-x86_64 as base-amd64-v1 +FROM bellsoft/liberica-openjdk-alpine:10.0.2-armv7l as base-arm-v7 -COPY qemu-aarch64-static /usr/bin/ -COPY qemu-arm-static /usr/bin/ +FROM bellsoft/liberica-openjdk-debian:11.0.20-aarch64 as base-arm64-v1 +ENV ISDEB=1 +FROM balenalib/raspberry-pi as base-arm-v6 +ENV ISDEB=1 -FROM builder +FROM base-${TARGETARCH}-${TARGETVARIANT:-v1} -ARG ARCH=armhf ARG VERSION="2.1.2" LABEL maintainer="Jay MOULIN " -LABEL version="${VERSION}-${ARCH}" +LABEL version="${VERSION}-${TARGETPLATFORM}" ENV LD_LIBRARY_PATH=/lib;/lib32;/usr/lib ENV XDG_DOWNLOAD_DIR=/opt/JDownloader/Downloads ENV LC_CTYPE="en_US.UTF-8" @@ -17,15 +19,10 @@ ENV LC_COLLATE="C" ENV LANGUAGE="C.UTF-8" ENV LC_ALL="C.UTF-8" ENV UMASK='' -COPY ./${ARCH}/*.jar /opt/JDownloader/libs/ +COPY ./${TARGETPLATFORM}/*.jar /opt/JDownloader/libs/ # archive extraction uses sevenzipjbinding library # which is compiled against libstdc++ -RUN mkdir -p /opt/JDownloader/app && \ - apk add --update libstdc++ ffmpeg wget procps && \ - wget -O /opt/JDownloader/JDownloader.jar "http://installer.jdownloader.org/JDownloader.jar?$RANDOM" && \ - chmod 777 /opt/JDownloader/ -R && \ - apk del wget --purge && \ - rm /usr/bin/qemu-*-static +RUN mkdir -p /opt/JDownloader/app COPY daemon.sh /opt/JDownloader/ COPY default-config.json.dist /opt/JDownloader/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json.dist @@ -34,5 +31,15 @@ COPY configure.sh /usr/bin/configure EXPOSE 3129 WORKDIR /opt/JDownloader - CMD ["/opt/JDownloader/daemon.sh"] + +RUN if [ "" = "$ISDEB" ]; then apk add --update libstdc++ ffmpeg wget procps && \ + wget -O /opt/JDownloader/JDownloader.jar "http://installer.jdownloader.org/JDownloader.jar?$RANDOM" && \ + chmod 777 /opt/JDownloader/ -R && \ + apk del wget --purge; \ + else apt-get update && \ + apt-get install ffmpeg wget procps -y && \ + (java -version || apt-get install openjdk-8-jre) && \ + wget -O /opt/JDownloader/JDownloader.jar "http://installer.jdownloader.org/JDownloader.jar?$RANDOM" && \ + chmod 777 /opt/JDownloader/ -R && \ + apt-get autoremove -y wget; fi diff --git a/Makefile b/Makefile index 0ec7ce6..719b068 100644 --- a/Makefile +++ b/Makefile @@ -1,44 +1,10 @@ -VERSION ?= 2.1.2 +VERSION ?= 2.1.3 CACHE ?= --no-cache=1 -FULLVERSION ?= ${VERSION} -archs ?= amd64 arm32v6 armhf arm64v8 -.PHONY: all build publish latest -all: build publish latest -qemu-arm-static: - cp /usr/bin/qemu-arm-static . -qemu-aarch64-static: - cp /usr/bin/qemu-aarch64-static . -build: qemu-arm-static qemu-aarch64-static - $(foreach arch,$(archs), \ - FILE=Dockerfile; \ - if [ $(arch) = amd64 ]; \ - then archi=$(arch); \ - image=bellsoft\\/liberica-openjdk-alpine:10.0.2-x86_64; \ - elif [ $(arch) = arm32v6 ]; \ - then archi=armel; \ - image=balenalib\\/raspberry-pi; \ - FILE=debian.Dockerfile; \ - elif [ $(arch) = armhf ]; \ - then archi=$(arch); \ - image=bellsoft\\/liberica-openjdk-alpine:10.0.2-armv7l; \ - else \ - archi=arm64; \ - image=bellsoft\\/liberica-openjdk-debian:11.0.20-aarch64; \ - FILE=debian.Dockerfile; \ - fi; \ - cat $$FILE | sed "s/FROM openjdk:jre-alpine/FROM $$image/g" > .Dockerfile; \ - docker build -t ghcr.io/jaymoulin/jdownloader:${VERSION}-$(arch) -t jaymoulin/jdownloader:${VERSION}-$(arch) -f .Dockerfile --build-arg ARCH=$${archi} ${CACHE} --build-arg VERSION=${VERSION} .;\ - ) +.PHONY: all build publish +all: build publish +build: + docker buildx build --platform linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64 ${PUSH} --build-arg VERSION=${VERSION} --tag jaymoulin/jdownloader --tag jaymoulin/jdownloader:${VERSION} ${CACHE} . publish: - docker push jaymoulin/jdownloader -a - docker push ghcr.io/jaymoulin/jdownloader -a - cat manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest.yaml - cat manifest.yaml | sed "s/\$$FULLVERSION/${FULLVERSION}/g" > manifest2.yaml - mv manifest2.yaml manifest.yaml - manifest-tool push from-spec manifest.yaml - cat manifest.yaml | sed "s/jaymoulin/ghcr.io\/jaymoulin/g" > manifest2.yaml - mv manifest2.yaml manifest.yaml - manifest-tool push from-spec manifest.yaml -latest: - FULLVERSION=latest VERSION=${VERSION} make publish + PUSH=--push CACHE= make build + diff --git a/README.md b/README.md index ce5d2f1..8b588f9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +> [!CAUTION] +> As-of 2021, this product does not have a free support team anymore. If you want this product to be maintained, please support my work. + +> [!NOTE] +> (This product is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added.) + ![logo](logo.png "logo") JDownloader 2 - Docker Image @@ -10,13 +16,10 @@ JDownloader 2 - Docker Image [![Buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png "Buy me a coffee")](https://www.buymeacoffee.com/jaymoulin) [![Buy me a coffee](https://ko-fi.com/img/githubbutton_sm.svg "Buy me a coffee")](https://www.ko-fi.com/jaymoulin) -DISCLAIMER: As-of 2021, this product does not have a free support team anymore. If you want this product to be maintained, please support on Patreon. - -(This product is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance, support and stability there are many desirable features yet to be added.) - # Headline -This image allows you to have JDownloader 2 easily installed and controlled via [MyJDownloader](https://my.jdownloader.org/), thanks to Docker. No cluncky and rusty VNC sessions here! +This image allows you to have JDownloader 2 easily installed and controlled via [MyJDownloader](https://my.jdownloader.org/), thanks to Docker. +No cluncky and rusty VNC sessions here! No graphical interface - No problem! Installation --- @@ -117,7 +120,9 @@ spec: type: Directory ``` -*Note for RPI Zero* : specify that you want the arm32v6 image (e.g. jaymoulin/jdownloader:0.7.0-arm32v6) because rpi zero identify itself as armhf which is wrong. +> [!CAUTION] +> *Note for RPI Zero* +> You may need to specify that you want the arm32v6 image (e.g. `docker run -d --platform=linux/arm/v6 jaymoulin/jdownloader`) because rpi zero identifies itself as armhf which is incorrect (https://github.com/moby/moby/issues/41017) (https://github.com/moby/moby/issues/34875). Configuration --- @@ -192,12 +197,3 @@ To get Direct Connection when using a bridged newtwork, please follow these step You can put a file called `jdownloader-block.txt` file in your Download folder to pause the container start. This will allow to connect to the container with a shell to debug. (`docker exec -it jdownloader sh`) -### Install Docker - -If you don't have Docker installed yet, you can do it easily in one line using this command - -``` -curl -sSL "https://gist.githubusercontent.com/jaymoulin/e749a189511cd965f45919f2f99e45f3/raw/0e650b38fde684c4ac534b254099d6d5543375f1/ARM%2520(Raspberry%2520PI)%2520Docker%2520Install" | sudo sh && sudo usermod -aG docker $USER -``` - - diff --git a/debian.Dockerfile b/debian.Dockerfile deleted file mode 100755 index 66184c0..0000000 --- a/debian.Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -FROM openjdk:jre-alpine as builder - -COPY qemu-arm-static /usr/bin/ -COPY qemu-aarch64-static /usr/bin/ - -FROM builder - -ARG ARCH=armel -ARG VERSION="2.1.2" -LABEL maintainer="Jay MOULIN " -LABEL version="${VERSION}-${ARCH}" - -COPY ./${ARCH}/*.jar /opt/JDownloader/libs/ -ENV XDG_DOWNLOAD_DIR=/opt/JDownloader/Downloads - -# archive extraction uses sevenzipjbinding library -# which is compiled against libstdc++ -RUN mkdir -p /opt/JDownloader/app/ && \ - apt-get update && \ - apt-get install ffmpeg wget procps -y && \ - (java -version || apt-get install openjdk-8-jre) && \ - wget -O /opt/JDownloader/JDownloader.jar "http://installer.jdownloader.org/JDownloader.jar?$RANDOM" && \ - chmod 777 /opt/JDownloader/ -R && \ - apt-get autoremove -y wget && \ - rm /usr/bin/qemu-*-static - -COPY daemon.sh /opt/JDownloader/ -COPY default-config.json.dist /opt/JDownloader/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json.dist -COPY configure.sh /usr/bin/configure - -EXPOSE 3129 -WORKDIR /opt/JDownloader - -CMD ["/opt/JDownloader/daemon.sh"] diff --git a/i386/sevenzipjbinding1509.jar b/linux/386/sevenzipjbinding1509.jar similarity index 100% rename from i386/sevenzipjbinding1509.jar rename to linux/386/sevenzipjbinding1509.jar diff --git a/i386/sevenzipjbinding1509Linux.jar b/linux/386/sevenzipjbinding1509Linux.jar similarity index 100% rename from i386/sevenzipjbinding1509Linux.jar rename to linux/386/sevenzipjbinding1509Linux.jar diff --git a/amd64/sevenzipjbinding1509.jar b/linux/amd64/sevenzipjbinding1509.jar similarity index 100% rename from amd64/sevenzipjbinding1509.jar rename to linux/amd64/sevenzipjbinding1509.jar diff --git a/amd64/sevenzipjbinding1509Linux.jar b/linux/amd64/sevenzipjbinding1509Linux.jar similarity index 100% rename from amd64/sevenzipjbinding1509Linux.jar rename to linux/amd64/sevenzipjbinding1509Linux.jar diff --git a/armel/sevenzipjbinding1509.jar b/linux/arm/v6/sevenzipjbinding1509.jar similarity index 100% rename from armel/sevenzipjbinding1509.jar rename to linux/arm/v6/sevenzipjbinding1509.jar diff --git a/armel/sevenzipjbinding1509LinuxArmVersion.jar b/linux/arm/v6/sevenzipjbinding1509LinuxArmVersion.jar similarity index 100% rename from armel/sevenzipjbinding1509LinuxArmVersion.jar rename to linux/arm/v6/sevenzipjbinding1509LinuxArmVersion.jar diff --git a/armhf/sevenzipjbinding1509.jar b/linux/arm/v7/sevenzipjbinding1509.jar similarity index 100% rename from armhf/sevenzipjbinding1509.jar rename to linux/arm/v7/sevenzipjbinding1509.jar diff --git a/armhf/sevenzipjbinding1509LinuxArmVersion.jar b/linux/arm/v7/sevenzipjbinding1509LinuxArmVersion.jar similarity index 100% rename from armhf/sevenzipjbinding1509LinuxArmVersion.jar rename to linux/arm/v7/sevenzipjbinding1509LinuxArmVersion.jar diff --git a/arm64/sevenzipjbinding1509.jar b/linux/arm64/v8/sevenzipjbinding1509.jar similarity index 100% rename from arm64/sevenzipjbinding1509.jar rename to linux/arm64/v8/sevenzipjbinding1509.jar diff --git a/arm64/sevenzipjbinding1509LinuxArm64.jar b/linux/arm64/v8/sevenzipjbinding1509LinuxArm64.jar similarity index 100% rename from arm64/sevenzipjbinding1509LinuxArm64.jar rename to linux/arm64/v8/sevenzipjbinding1509LinuxArm64.jar diff --git a/manifest.yml b/manifest.yml deleted file mode 100644 index 8172f2d..0000000 --- a/manifest.yml +++ /dev/null @@ -1,23 +0,0 @@ -image: jaymoulin/jdownloader:$FULLVERSION -manifests: - - image: jaymoulin/jdownloader:$VERSION-arm32v6 - platform: - architecture: arm - variant: v6 - os: linux - - - image: jaymoulin/jdownloader:$VERSION-armhf - platform: - architecture: arm - variant: v7 - os: linux - - - image: jaymoulin/jdownloader:$VERSION-arm64v8 - platform: - architecture: arm64 - os: linux - - - image: jaymoulin/jdownloader:$VERSION-amd64 - platform: - architecture: amd64 - os: linux