Skip to content

Commit

Permalink
Moved from manifest to buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed May 3, 2024
1 parent c9eba4c commit 1e24ba1
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 136 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ 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
run: make publish latest
run: make publish
3 changes: 0 additions & 3 deletions .gitignore

This file was deleted.

35 changes: 21 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <https://brands.jaymoulin.me/me/docker-jdownloader>"
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"
Expand All @@ -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
Expand All @@ -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
48 changes: 7 additions & 41 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
---
Expand Down Expand Up @@ -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
---
Expand Down Expand Up @@ -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
```
34 changes: 0 additions & 34 deletions debian.Dockerfile

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 0 additions & 23 deletions manifest.yml

This file was deleted.

0 comments on commit 1e24ba1

Please sign in to comment.