Improve building special images

This commit is contained in:
Florian Zirker 2025-07-23 09:34:25 +02:00
parent 9a1ae65708
commit 4fe31b5135
6 changed files with 23 additions and 6 deletions

View file

@ -1,4 +1,4 @@
ARG NC_MAIN_VERSION ARG NC_MAIN_VERSION=stable
FROM nextcloud:$NC_MAIN_VERSION-fpm FROM nextcloud:$NC_MAIN_VERSION-fpm
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \

View file

@ -8,8 +8,8 @@ tasks:
pull: pull:
desc: Pull all images for {{.NAME}} and build images desc: Pull all images for {{.NAME}} and build images
dir: "{{.TASKFILE_DIR}}" dir: "{{.TASKFILE_DIR}}"
deps: [build]
cmds: cmds:
- docker compose build --pull
- docker compose pull --ignore-buildable - docker compose pull --ignore-buildable
up: up:
@ -18,6 +18,13 @@ tasks:
cmds: cmds:
- docker compose up -d - docker compose up -d
build:
desc: "Building special Nextcloud image (Mainly install software)"
dir: "{{.TASKFILE_DIR}}"
dotenv: [.env]
cmds:
- docker build --pull --build-arg NC_MAIN_VERSION=$NC_MAIN_VERSION --tag $DOCKER_REGISTRY/nextcloud:${NC_MAIN_VERSION}-fpm .
down: down:
desc: Stop {{.NAME}} docker compose desc: Stop {{.NAME}} docker compose
dir: "{{.TASKFILE_DIR}}" dir: "{{.TASKFILE_DIR}}"

View file

@ -49,7 +49,7 @@ services:
cron: cron:
image: nextcloud:${NC_MAIN_VERSION}-fpm-own image: ${DOCKER_REGISTRY}/nextcloud:${NC_MAIN_VERSION}-fpm
build: build:
context: ./ context: ./
args: args:

View file

@ -8,9 +8,17 @@ tasks:
pull: pull:
desc: Pull all images for {{.NAME}} desc: Pull all images for {{.NAME}}
dir: "{{.TASKFILE_DIR}}" dir: "{{.TASKFILE_DIR}}"
deps: [build]
cmds: cmds:
- docker compose pull --ignore-buildable - docker compose pull --ignore-buildable
build:
desc: "Building special Caddy image with netcup support"
dir: "{{.TASKFILE_DIR}}"
dotenv: [.env]
cmds:
- docker build --pull --file caddy/Dockerfile --build-arg CADDY_VERSION=$CADDY_VERSION --tag $DOCKER_REGISTRY/caddy:${CADDY_VERSION} .
up: up:
desc: Starting {{.NAME}} docker compose as daemon desc: Starting {{.NAME}} docker compose as daemon
dir: "{{.TASKFILE_DIR}}" dir: "{{.TASKFILE_DIR}}"

View file

@ -1,7 +1,9 @@
FROM caddy:2-builder AS builder ARG CADDY_VERSION=2
FROM caddy:${CADDY_VERSION}-builder AS builder
RUN xcaddy build --with github.com/caddy-dns/netcup RUN xcaddy build --with github.com/caddy-dns/netcup
FROM caddy:2 FROM caddy:${CADDY_VERSION}
COPY --from=builder /usr/bin/caddy /usr/bin/caddy COPY --from=builder /usr/bin/caddy /usr/bin/caddy

View file

@ -1,7 +1,7 @@
services: services:
caddy: caddy:
image: florianzirker.de/caddy-netcup image: ${DOCKER_REGISTRY}/caddy:${CADDY_VERSION}
build: ./caddy build: ./caddy
networks: networks:
- web - web