Add cloudflared (#138)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Samuel Gagnon 2024-01-07 15:18:55 -05:00 committed by GitHub
parent dcb79f2c0b
commit b046181915
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View file

@ -32,6 +32,15 @@
], ],
"datasourceTemplate": "github-releases", "datasourceTemplate": "github-releases",
"depNameTemplate": "louislam/uptime-kuma" "depNameTemplate": "louislam/uptime-kuma"
},
{
"fileMatch": ["/Dockerfile$"],
"matchStrings": [
"ARG CLOUDFLARED_VERSION=[\"']?(?<currentValue>.+?)[\"']?\\s+"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "cloudflare/cloudflared",
"versioningTemplate": "loose"
} }
], ],
"packageRules": [ "packageRules": [

View file

@ -13,6 +13,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Setup base # Setup base
ARG UPTIME_KUMA_VERSION="1.23.11" ARG UPTIME_KUMA_VERSION="1.23.11"
ARG CLOUDFLARED_VERSION="2023.10.0"
ARG BUILD_ARCH=amd64
# hadolint ignore=DL3003,DL3042 # hadolint ignore=DL3003,DL3042
RUN \ RUN \
apk add --no-cache --virtual .build-dependencies \ apk add --no-cache --virtual .build-dependencies \
@ -39,6 +41,13 @@ RUN \
--omit=dev \ --omit=dev \
&& npm run download-dist \ && npm run download-dist \
\ \
&& if [ "${BUILD_ARCH}" = "aarch64" ]; then CLOUDFLARED_ARCH="arm64"; \
elif [ "${BUILD_ARCH}" = "amd64" ]; then CLOUDFLARED_ARCH="amd64"; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then CLOUDFLARED_ARCH="arm"; fi \
&& curl -L --fail -o /usr/bin/cloudflared \
"https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-${CLOUDFLARED_ARCH}" \
&& chmod +x /usr/bin/cloudflared \
\
&& npm cache clear --force \ && npm cache clear --force \
\ \
&& apk del --no-cache --purge .build-dependencies \ && apk del --no-cache --purge .build-dependencies \
@ -48,12 +57,10 @@ RUN \
/root/.npm \ /root/.npm \
/root/.npmrc /root/.npmrc
# Copy root filesystem # Copy root filesystem
COPY rootfs / COPY rootfs /
# Build arguments # Build arguments
ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION
ARG BUILD_NAME ARG BUILD_NAME