1 Commits

Author SHA1 Message Date
22c8f29df0 Update docker Docker tag to v20.10.24
Some checks failed
continuous-integration/drone/push Build is failing
2025-03-25 03:00:24 +00:00
5 changed files with 72 additions and 213 deletions

View File

@@ -1,130 +1,56 @@
---
kind: pipeline kind: pipeline
type: kubernetes type: docker
name: amd64-main name: build
node_selector: # Ensure this runs on an amd64 runner platform:
kubernetes.io/arch: amd64 os: linux
trigger: # Only run on pushes to the main branch arch: arm64
event: [ push ]
branch: [ main ]
steps:
- name: build_push_amd64_latest
image: plugins/docker # Use Docker plugin to build and push image
settings:
repo: bottledpills/deluge-openvpn
dockerfile: docker/Dockerfile.amd64
tags:
- latest-linux-amd64 # Tag for amd64 variant (main branch → "latest")
username:
from_secret: docker_username # Docker registry credentials (secret)
password:
from_secret: docker_password
--- trigger:
kind: pipeline event:
type: kubernetes - push
name: arm64-main
node_selector: # Ensure this runs on an arm64 runner
kubernetes.io/arch: arm64
trigger: # Only run on pushes to the main branch
event: [ push ]
branch: [ main ]
steps:
- name: build_push_arm64_latest
image: plugins/docker
settings:
repo: bottledpills/deluge-openvpn
dockerfile: docker/Dockerfile.arm64
tags:
- latest-linux-arm64 # Tag for arm64 variant (main branch → "latest")
username:
from_secret: docker_username
password:
from_secret: docker_password
--- services:
kind: pipeline - name: docker
type: kubernetes image: docker:20.10.24-dind
name: amd64-tag privileged: true
node_selector: environment:
kubernetes.io/arch: amd64 DOCKER_TLS_CERTDIR: ""
trigger: # Only run on creation of Git tags (releases)
event: [ tag ]
steps:
- name: build_push_amd64_version
image: plugins/docker
settings:
repo: bottledpills/deluge-openvpn
dockerfile: docker/Dockerfile.amd64
# Use Drone env substitution to strip the leading "v" from the tag [oai_citation_attribution:0‡docs.drone.io](https://docs.drone.io/pipeline/environment/substitution/#:~:text=,0)
tags:
- ${DRONE_TAG##v}-linux-amd64 # e.g. "v2.0.1" → "2.0.1-linux-amd64"
username:
from_secret: docker_username
password:
from_secret: docker_password
---
kind: pipeline
type: kubernetes
name: arm64-tag
node_selector:
kubernetes.io/arch: arm64
trigger: # Only run on creation of Git tags (releases)
event: [ tag ]
steps: steps:
- name: build_push_arm64_version - name: docker-login
image: plugins/docker image: docker:20.10.24
settings: environment:
repo: bottledpills/deluge-openvpn DOCKER_BUILDKIT: 1
dockerfile: docker/Dockerfile.arm64 DOCKER_HOST: tcp://docker:2375
tags: DOCKER_USERNAME:
- ${DRONE_TAG##v}-linux-arm64 # e.g. "v2.0.1" → "2.0.1-linux-arm64" from_secret: docker_username
username: DOCKER_PASSWORD:
from_secret: docker_username from_secret: docker_password
password: commands:
from_secret: docker_password - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
--- - name: create-builder
kind: pipeline image: docker:20.10.24
type: kubernetes environment:
name: manifest-main DOCKER_BUILDKIT: 1
# The manifest step can run on either architecture; we'll use amd64 for consistency DOCKER_HOST: tcp://docker:2375
node_selector: commands:
kubernetes.io/arch: amd64 - docker buildx create --use --name multi-builder || docker buildx use multi-builder
trigger: # Run on main branch pushes (to create "latest" manifest)
event: [ push ]
branch: [ main ]
depends_on: # Wait for both arch images to be built and pushed
- amd64-main
- arm64-main
steps:
- name: push_manifest_latest
image: plugins/manifest # Drone manifest plugin to create multi-arch manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
spec: docker/manifest.tmpl # Use external manifest template for tags and images
--- - name: bootstrap
kind: pipeline image: docker:20.10.24
type: kubernetes environment:
name: manifest-tag DOCKER_BUILDKIT: 1
node_selector: DOCKER_HOST: tcp://docker:2375
kubernetes.io/arch: amd64 commands:
trigger: # Run on tag events (to create versioned manifest) - docker buildx inspect --bootstrap
event: [ tag ]
depends_on: - name: build-push
- amd64-tag image: docker:20.10.24
- arm64-tag environment:
steps: DOCKER_BUILDKIT: 1
- name: push_manifest_version DOCKER_HOST: tcp://docker:2375
image: plugins/manifest DOCKER_USERNAME:
settings: from_secret: docker_username
username: commands:
from_secret: docker_username - docker buildx build --platform linux/amd64,linux/arm64 -t ${DOCKER_USERNAME}/deluge-openvpn:dev --push .
password:
from_secret: docker_password
spec: docker/manifest.tmpl # Same template handles both latest and version tags

View File

@@ -9,12 +9,28 @@ RUN apt-get update && apt-get -y install curl software-properties-common
# Step 2: Add the Deluge PPA and update apt cache # Step 2: Add the Deluge PPA and update apt cache
RUN add-apt-repository -u ppa:deluge-team/stable && apt-get update RUN add-apt-repository -u ppa:deluge-team/stable && apt-get update
# Step 3: Download dumb-init asset for amd64 # Step 3: Download dumb-init asset based on architecture
RUN curl -Lo /tmp/dumb-init "$DUMB_INIT_BASE_URL/dumb-init_1.2.5_amd64.deb" RUN arch=$(dpkg --print-architecture) && \
if [ "$arch" = "arm64" ]; then \
asset="dumb-init_1.2.5_aarch64"; \
elif [ "$arch" = "amd64" ]; then \
asset="dumb-init_1.2.5_amd64.deb"; \
else \
echo "Unsupported architecture: $arch" && exit 1; \
fi && \
echo "Downloading dumb-init asset: $asset" && \
curl -Lo /tmp/dumb-init "$DUMB_INIT_BASE_URL/$asset"
# Step 4: Install dumb-init for amd64 # Step 4: Install dumb-init based on asset type
RUN dpkg-deb -x /tmp/dumb-init /tmp/dumb-init-dir && \ RUN arch=$(dpkg --print-architecture) && \
cp /tmp/dumb-init-dir/usr/bin/dumb-init /usr/local/bin/dumb-init && \ if [ "$arch" = "amd64" ]; then \
dpkg-deb -x /tmp/dumb-init /tmp/dumb-init-dir && \
cp /tmp/dumb-init-dir/usr/bin/dumb-init /usr/local/bin/dumb-init; \
elif [ "$arch" = "amd64" ]; then \
cp /tmp/dumb-init /usr/local/bin/dumb-init; \
else \
echo "Unsupported architecture: $arch" && exit 1; \
fi && \
chmod +x /usr/local/bin/dumb-init && \ chmod +x /usr/local/bin/dumb-init && \
rm -rf /tmp/dumb-init /tmp/dumb-init-dir rm -rf /tmp/dumb-init /tmp/dumb-init-dir

View File

@@ -1,7 +1,7 @@
# OpenVPN and Deluge with WebUI # OpenVPN and Deluge with WebUI
[![Build Status](https://drone.beatrice.wtf/api/badges/bea/docker-deluge-openvpn/status.svg)](https://drone.beatrice.wtf/bea/docker-deluge-openvpn) ![Build/Push (master)](https://github.com/ebrianne/docker-deluge-openvpn/workflows/Build/Push%20(master)/badge.svg?branch=master)
[![Docker Pulls](https://img.shields.io/docker/pulls/bottledpills/deluge-openvpn.svg)](https://hub.docker.com/r/bottledpills/deluge-openvpn/) [![Docker Pulls](https://img.shields.io/docker/pulls/ebrianne/docker-deluge-openvpn.svg)](https://hub.docker.com/r/ebrianne/docker-deluge-openvpn/)
## Acknowledgments ## Acknowledgments

View File

@@ -1,69 +0,0 @@
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND="noninteractive"
ENV DUMB_INIT_BASE_URL="https://github.com/Yelp/dumb-init/releases/download/v1.2.5"
# Step 1: Install prerequisites
RUN apt-get update && apt-get -y install curl software-properties-common
# Step 2: Add the Deluge PPA and update apt cache
RUN add-apt-repository -u ppa:deluge-team/stable && apt-get update
# Step 3: Download dumb-init asset for arm64
RUN curl -Lo /tmp/dumb-init "$DUMB_INIT_BASE_URL/dumb-init_1.2.5_aarch64"
# Step 4: Install dumb-init for arm64
RUN cp /tmp/dumb-init /usr/local/bin/dumb-init && \
chmod +x /usr/local/bin/dumb-init && \
rm -rf /tmp/dumb-init
# Step 5: Install other dependencies
RUN apt-get -y install iputils-ping dnsutils bash jq net-tools openvpn curl ufw deluged deluge-web p7zip-full unrar unzip
# Step 6: Clean up apt cache and temporary files
RUN rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
# Step 7: Add the user "abc"
RUN groupmod -g 1000 users && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc
# Step 8: Copy configuration and scripts
COPY root/ /
# Step 9: Set environment variables
ENV OPENVPN_USERNAME=**None** \
OPENVPN_PASSWORD=**None** \
OPENVPN_PROVIDER=**None** \
GLOBAL_APPLY_PERMISSIONS=true \
TZ=Europe/Berlin \
DELUGE_WEB_PORT=8112 \
DELUGE_DEAMON_PORT=58846 \
DELUGE_DOWNLOAD_DIR=/download/completed \
DELUGE_INCOMPLETE_DIR=/download/incomplete \
DELUGE_TORRENT_DIR=/download/torrents \
DELUGE_WATCH_DIR=/download/watch \
CREATE_TUN_DEVICE=true \
ENABLE_UFW=false \
UFW_ALLOW_GW_NET=false \
UFW_EXTRA_PORTS= \
UFW_DISABLE_IPTABLES_REJECT=false \
PUID= \
PGID= \
UMASK=022 \
PEER_DNS=true \
PEER_DNS_PIN_ROUTES=true \
DROP_DEFAULT_ROUTE= \
HEALTH_CHECK_HOST=google.com \
LOG_TO_STDOUT=false \
DELUGE_LISTEN_PORT_LOW=53394 \
DELUGE_LISTEN_PORT_HIGH=53404 \
DELUGE_OUTGOING_PORT_LOW=63394 \
DELUGE_OUTGOING_PORT_HIGH=63404
# Step 10: Configure health check and expose ports
HEALTHCHECK --interval=1m CMD /etc/scripts/healthcheck.sh
EXPOSE 8112 58846
# Step 11: Set default command
CMD ["/usr/local/bin/dumb-init", "/etc/openvpn/init.sh"]

View File

@@ -1,14 +0,0 @@
# docker/manifest.tmpl
image: bottledpills/deluge-openvpn:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
manifests:
- image: bottledpills/deluge-openvpn:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
- image: bottledpills/deluge-openvpn:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
os: linux
variant: v8