mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-19 01:46:10 -04:00
add versioning
This commit is contained in:
@@ -15,14 +15,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Build image
|
- name: Build image
|
||||||
run: |
|
run: |
|
||||||
docker build --no-cache -t ${{ github.sha }} .
|
CLOUDFLARED_TAG=$(curl -s https://api.github.com/repos/cloudflare/cloudflared/releases/latest | jq -rc ".tag_name")
|
||||||
|
echo "CLOUDFLARED_TAG=${CLOUDFLARED_TAG}" >> $GITHUB_ENV
|
||||||
|
docker build --no-cache --build-arg CLOUDFLARED_TAG=${CLOUDFLARED_TAG} -t ${{ github.sha }} .
|
||||||
|
|
||||||
- name: Tag image
|
- name: Tag image
|
||||||
if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) }}
|
if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) }}
|
||||||
run: |
|
run: |
|
||||||
docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}
|
docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}
|
||||||
|
docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${CLOUDFLARED_TAG}
|
||||||
|
docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${CLOUDFLARED_TAG}-${{ github.sha }}
|
||||||
docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
|
docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
|
||||||
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}
|
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}
|
||||||
|
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${CLOUDFLARED_TAG}
|
||||||
|
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${CLOUDFLARED_TAG}-${{ github.sha }}
|
||||||
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
|
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
|
||||||
|
|
||||||
- name: Credential check
|
- name: Credential check
|
||||||
@@ -48,6 +54,8 @@ jobs:
|
|||||||
if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.CR_USER && env.CR_PAT }}
|
if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.CR_USER && env.CR_PAT }}
|
||||||
run: |
|
run: |
|
||||||
docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
|
docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
|
||||||
|
docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${CLOUDFLARED_TAG}-${{ github.sha }}
|
||||||
|
docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${CLOUDFLARED_TAG}
|
||||||
docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}
|
docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
@@ -59,4 +67,6 @@ jobs:
|
|||||||
if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.DOCKERUSER && env.DOCKERPASS }}
|
if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.DOCKERUSER && env.DOCKERPASS }}
|
||||||
run: |
|
run: |
|
||||||
docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
|
docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
|
||||||
|
docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${CLOUDFLARED_TAG}-${{ github.sha }}
|
||||||
|
docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${CLOUDFLARED_TAG}
|
||||||
docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}
|
docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}
|
||||||
|
|||||||
+19
-13
@@ -1,7 +1,9 @@
|
|||||||
# Build container
|
# Build container
|
||||||
FROM golang:alpine AS buildstage
|
FROM golang:alpine AS buildstage
|
||||||
|
|
||||||
RUN mkdir /cloudflared
|
ARG CLOUDFLARED_TAG
|
||||||
|
|
||||||
|
RUN mkdir -p /root-layer/cloudflared
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
RUN apk --no-cache add git build-base curl jq
|
RUN apk --no-cache add git build-base curl jq
|
||||||
@@ -9,26 +11,30 @@ RUN apk --no-cache add git build-base curl jq
|
|||||||
ENV GO111MODULE=on \
|
ENV GO111MODULE=on \
|
||||||
CGO_ENABLED=0
|
CGO_ENABLED=0
|
||||||
|
|
||||||
RUN curl -s https://api.github.com/repos/cloudflare/cloudflared/releases/latest \
|
RUN \
|
||||||
| jq -rc ".tag_name" \
|
if [ -z "${CLOUDFLARED_TAG}" ]; then \
|
||||||
| xargs -I TAG sh -c 'git -c advice.detachedHead=false clone https://github.com/cloudflare/cloudflared --depth=1 --branch TAG .'
|
curl -s https://api.github.com/repos/cloudflare/cloudflared/releases/latest \
|
||||||
|
| jq -rc ".tag_name" \
|
||||||
|
| xargs -I TAG sh -c 'git -c advice.detachedHead=false clone https://github.com/cloudflare/cloudflared --depth=1 --branch TAG .'; \
|
||||||
|
else \
|
||||||
|
git -c advice.detachedHead=false clone https://github.com/cloudflare/cloudflared --depth=1 --branch ${CLOUDFLARED_TAG} .; \
|
||||||
|
fi
|
||||||
|
|
||||||
RUN GOOS=linux GOARCH=amd64 make cloudflared
|
RUN GOOS=linux GOARCH=amd64 make cloudflared
|
||||||
RUN mv cloudflared /cloudflared/cloudflared-amd64
|
RUN mv cloudflared /root-layer/cloudflared/cloudflared-amd64
|
||||||
|
|
||||||
RUN GOOS=linux GOARCH=arm64 make cloudflared
|
RUN GOOS=linux GOARCH=arm64 make cloudflared
|
||||||
RUN mv cloudflared /cloudflared/cloudflared-arm64
|
RUN mv cloudflared /root-layer/cloudflared/cloudflared-arm64
|
||||||
|
|
||||||
RUN GOOS=linux GOARCH=arm make cloudflared
|
RUN GOOS=linux GOARCH=arm make cloudflared
|
||||||
RUN mv cloudflared /cloudflared/cloudflared-armhf
|
RUN mv cloudflared /root-layer/cloudflared/cloudflared-armhf
|
||||||
|
|
||||||
# Runtime container
|
COPY root/ /root-layer/
|
||||||
|
|
||||||
|
## Single layer deployed image ##
|
||||||
FROM scratch
|
FROM scratch
|
||||||
WORKDIR /
|
|
||||||
|
|
||||||
LABEL maintainer="Spunkie"
|
LABEL maintainer="Spunkie"
|
||||||
|
|
||||||
# copy cloudflared bins
|
# Add files from buildstage
|
||||||
COPY --from=buildstage /cloudflared /cloudflared
|
COPY --from=buildstage /root-layer/ /
|
||||||
# copy local files
|
|
||||||
COPY root/ /
|
|
||||||
|
|||||||
Reference in New Issue
Block a user