Updated docker image to use Alpine (reduces in image size). Cleaned up s6-overlay config.

This commit is contained in:
Shawn Anderson 2023-03-16 09:40:01 -04:00
parent b7a6920517
commit caabc769e4
10 changed files with 21 additions and 19 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@ node_modules/
RealDebridClient.zip RealDebridClient.zip
server/RdtClient.Web/appsettings.Development.json server/RdtClient.Web/appsettings.Development.json
data data
Dockerfile.dev

View file

@ -65,22 +65,16 @@ ENV RDTCLIENT_BRANCH="main"
RUN \ RUN \
mkdir -p /data/downloads /data/db || true && \ mkdir -p /data/downloads /data/db || true && \
echo "**** Updating package information ****" && \ echo "**** Updating package information ****" && \
apt-get update -y -qq && \ apk update && \
echo "**** Install pre-reqs ****" && \ echo "**** Install pre-reqs ****" && \
apt-get install -y -qq wget dos2unix && \ apk add bash icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib && \
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 && \ apk add aspnetcore6-runtime && \
chmod +x ./dotnet-install.sh && \
bash ./dotnet-install.sh -c LTS -v latest --runtime dotnet --install-dir /usr/share/dotnet && \
bash ./dotnet-install.sh -c LTS -v latest --runtime aspnetcore --install-dir /usr/share/dotnet && \
echo "**** Cleaning image ****" && \
apt-get -y -qq -o Dpkg::Use-Pty=0 clean && apt-get -y -qq -o Dpkg::Use-Pty=0 purge && \
echo "**** Setting permissions ****" && \ echo "**** Setting permissions ****" && \
chown -R abc:abc /data && \ chown -R abc:abc /data && \
rm -rf \ rm -rf \
/tmp/* \ /tmp/* \
/var/lib/apt/lists/* \ /var/cache/apk/* \
/var/tmp/* || true /var/tmp/* || true
ENV PATH "$PATH:/usr/share/dotnet" ENV PATH "$PATH:/usr/share/dotnet"
@ -93,7 +87,7 @@ COPY --from=node-build-env /appclient/root/ /
# ports and volumes # ports and volumes
EXPOSE 6500 EXPOSE 6500
VOLUME ["/config", "/data" ] VOLUME [ "/data" ]
# Check Status # Check Status
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD curl --fail http://localhost:6500 || exit HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD curl --fail http://localhost:6500 || exit

View file

@ -2,8 +2,9 @@
param( param(
[string]$TempPath="c:/Temp/RtdClient", [string]$TempPath="c:/Temp/RtdClient",
[string]$Dockerfile="Dockerfile",
[switch]$AutoAttach, [switch]$AutoAttach,
[switch]$IgnoreBuildCache, [switch]$SkipCache,
[string]$BuildProgress="auto" [string]$BuildProgress="auto"
) )
@ -17,8 +18,8 @@ Write-Host "removing Container (if exists)"
docker rm rdtclientdev docker rm rdtclientdev
Write-Host "Building Container" Write-Host "Building Container"
$dockerArgs = @( "build", "--force-rm", "--network host", "--tag", "rdtclientdev", "--progress=$BuildProgress", "." ) $dockerArgs = @( "build", "--force-rm", "--tag", "rdtclientdev", "--progress=$BuildProgress", "--file", $Dockerfile, "." )
if ($IgnoreBuildCache.IsPresent) { $dockerArgs += @("--no-cace" ) } if ($SkipCache.IsPresent) { $dockerArgs += @("--no-cache" ) }
& docker $dockerArgs & docker $dockerArgs
Write-Host "Starting Container" Write-Host "Starting Container"

View file

@ -35,6 +35,7 @@ param(
[string]$Version = "", [string]$Version = "",
[string]$DockerAccount = "rogerfar", [string]$DockerAccount = "rogerfar",
[string]$Platforms = "linux/arm/v7,linux/arm64/v8,linux/amd64", [string]$Platforms = "linux/arm/v7,linux/arm64/v8,linux/amd64",
[string]$Dockerfile = "Dockerfile",
[switch]$SkipPush, [switch]$SkipPush,
[switch]$SkipCache, [switch]$SkipCache,
[switch]$OutputToDocker [switch]$OutputToDocker
@ -42,7 +43,7 @@ param(
$imageName = "$($DockerAccount)/rdtclient" $imageName = "$($DockerAccount)/rdtclient"
$dockerArgs = @( "buildx", "build", "--network=default", "--platform", $Platforms, "--tag", "$($imageName):latest", "." ) $dockerArgs = @( "buildx", "build", "--network=default", "--platform", $Platforms, "--tag", "$($imageName):latest", "--file", $Dockerfile, "." )
if (-Not $SkipPush.IsPresent) { if (-Not $SkipPush.IsPresent) {
$dockerArgs += @("--push") $dockerArgs += @("--push")

View file

@ -10,4 +10,4 @@
# permissions # permissions
echo "Setting permissions" echo "Setting permissions"
chown -R abc:abc \ chown -R abc:abc \
/app /data /config /app /data

View file

@ -1 +1 @@
oneshot oneshot

View file

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

View file

@ -5,6 +5,11 @@ if [ -n "${UMASK_SET}" ] && [ -z "${UMASK}" ]; then
umask ${UMASK_SET} umask ${UMASK_SET}
fi fi
# permissions
echo "Setting permissions"
chown -R abc:abc \
/app /data
echo "Changing to /app folder" echo "Changing to /app folder"
cd /app || exit cd /app || exit

View file

@ -1 +1 @@
longrun longrun