Fixed docker build issues. Updated to latest linuxserver.io ubunutu image. Switched over to s6v3 for running service

This commit is contained in:
Shawn Anderson 2023-03-15 07:51:29 -04:00
parent 6d65de6f5f
commit c4ff8acbc0
13 changed files with 47 additions and 7 deletions

View file

@ -37,4 +37,4 @@ server/**/.vs
server/RdtClient.Web/wwwroot/ server/RdtClient.Web/wwwroot/
build/ build/
publish/ publish/data

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ publish/
node_modules/ node_modules/
RealDebridClient.zip RealDebridClient.zip
server/RdtClient.Web/appsettings.Development.json server/RdtClient.Web/appsettings.Development.json
data

View file

@ -36,7 +36,7 @@ RUN \
if [ "$TARGETPLATFORM" = "linux/arm/v7" ] ; then \ if [ "$TARGETPLATFORM" = "linux/arm/v7" ] ; then \
echo "**** Building $TARGETPLATFORM arm v7 version" && \ echo "**** Building $TARGETPLATFORM arm v7 version" && \
dotnet restore -r linux-arm RdtClient.sln && dotnet publish -r linux-arm -c Release -o out ; \ dotnet restore -r linux-arm RdtClient.sln && dotnet publish -r linux-arm -c Release -o out ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v8"] ; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v8" ] ; then \
echo "**** Building $TARGETPLATFORM arm v8 version" && \ echo "**** Building $TARGETPLATFORM arm v8 version" && \
dotnet restore -r linux-arm64 RdtClient.sln && dotnet publish -r linux-arm64 -c Release -o out ; \ dotnet restore -r linux-arm64 RdtClient.sln && dotnet publish -r linux-arm64 -c Release -o out ; \
else \ else \
@ -45,7 +45,7 @@ RUN \
fi fi
# Stage 3 - Build runtime image # Stage 3 - Build runtime image
FROM ghcr.io/linuxserver/baseimage-ubuntu:focal FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic
ARG TARGETPLATFORM ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
ARG BUILDPLATFORM ARG BUILDPLATFORM
@ -68,7 +68,7 @@ RUN \
apt-get update -y -qq && \ apt-get update -y -qq && \
echo "**** Install pre-reqs ****" && \ echo "**** Install pre-reqs ****" && \
apt-get install -y -qq wget dos2unix && \ apt-get install -y -qq wget dos2unix && \
apt-get install -y libc6 libgcc1 libgssapi-krb5-2 libssl1.1 libstdc++6 zlib1g libicu66 && \ apt-get install -y libc6 libgcc1 libgssapi-krb5-2 libssl1.1 libstdc++6 zlib1g libicu60 && \
echo "**** Installing dotnet ****" && \ echo "**** Installing dotnet ****" && \
wget -q https://dot.net/v1/dotnet-install.sh && \ wget -q https://dot.net/v1/dotnet-install.sh && \
chmod +x ./dotnet-install.sh && \ chmod +x ./dotnet-install.sh && \

29
docker-build-dev.ps1 Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env pwsh
param(
[string]$TempPath="c:/Temp/RtdClient",
[switch]$AutoAttach,
[switch]$IgnoreBuildCache,
[string]$BuildProgress="auto"
)
[string] $downloadPath = Join-Path -Path $TempPath -ChildPath "downloads"
[string] $dbPath = Join-Path -Path $TempPath -ChildPath "db"
Write-Host "Stopping Container (if already running)"
docker stop rdtclientdev
Write-Host "removing Container (if exists)"
docker rm rdtclientdev
Write-Host "Building Container"
$dockerArgs = @( "build", "--force-rm", "--tag", "rdtclientdev", "--progress=$BuildProgress", "." )
if ($IgnoreBuildCache.IsPresent) { $dockerArgs += @("--no-cace" ) }
& docker $dockerArgs
Write-Host "Starting Container"
docker run --cap-add=NET_ADMIN -d -v $downloadPath -v $dbPath --log-driver json-file --log-opt max-size=10m -p 6500:6500 --name rdtclientdev rdtclientdev
if ($AutoAttach.IsPresent) {
docker exec -it rdtclientdev /bin/bash
}

View file

@ -1,11 +1,18 @@
version: '3.3' version: '3.3'
services: services:
rdtclient: rdtclient:
image: rogerfar/rdtclient image: rogerfar/rdtclient
volumes:
- ./data/downloads:/data/downloads
- ./data/db:/data/db
container_name: rdtclient container_name: rdtclient
build:
context: .
dockerfile: Dockerfile
environment:
- PUID=1001
- PGID=1001
volumes:
- ${PWD}/data/downloads:/data/downloads
- ${PWD}/data/db:/data/db
restart: always restart: always
logging: logging:
driver: json-file driver: json-file

View file

@ -0,0 +1 @@
oneshot

View file

@ -0,0 +1 @@
etc/s6-overlay/s6-rc.d/init-rdt-client/run

View file

@ -0,0 +1 @@
longrun