[BUG] Custom deploy script for using certs in other containers

未关闭
#636 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
docker, nginx, shell

调研方向

The failure is in the deploy hook at /config/etc/letsencrypt/renewal-hooks/deploy/20-reload, which calls docker before the universal-docker mod has installed the binary. The container's init ordering, where mods are applied relative to the certbot renewal step, is the part to investigate. Done means the hook can run docker on the first renewal after container start. Reproducing requires a Docker environment with the mod and a forced renewal.

由索引模型根据 Issue 内容生成。

描述

Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

I have installed swag docker with linuxserver/mods:universal-docker mod
So that I can have docker command inside swag repository, for restarting other docker services, after certificate change.

But I have found out that the mods are installed after the certificate is renewed, and after the deploy hooks have run. Therefore on swag start they would error out.

Hook will work on the next run the next month when the next renewal will start.

Expected Behavior

The mods should be installed before certificate renewal process

Steps To Reproduce
  1. Create custom deploy hook that is using docker command
  2. Change for example SUBDOMAINS so that new certificate is needed
  3. Observe as hook errors out with docker command not found
  4. Observe installation of docker mod
Environment
- OS: Debian GNU/Linux 12
- How docker service was installed: apt, docker
CPU architecture

arm64

Docker creation
services:
  swag:
    container_name: swag
    image: lscr.io/linuxserver/swag:5.9.0
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - URL=XXX
      - VALIDATION=dns
      - SUBDOMAINS=X,XX,XXX #optional
#      - CERTPROVIDER= #optional
      - DNSPLUGIN=cloudflare #optional
#      - PROPAGATION=120 #optional
      - [email protected] #optional
      - ONLY_SUBDOMAINS=true #optional
#      - EXTRA_DOMAINS= #optional
      - STAGING=false #optional
      - DISABLE_F2B=true #optional
      - SWAG_AUTORELOAD=true #optional
#      - SWAG_AUTORELOAD_WATCHLIST= #optional

      - DOCKER_MODS=linuxserver/mods:universal-docker|linuxserver/mods:swag-dashboard
    volumes:
      - ./config:/config
      - '/var/run/docker.sock:/var/run/docker.sock'
      - ./modcache:/modcache
    dns:
     - 1.1.1.1
    networks:
      vlan:
        ipv4_address: X.X.X.X
    restart: unless-stopped

networks:
  vlan:
    external: true
Container logs
These files will be updated when the certificate renews.

NEXT STEPS:

- The certificate will need to be renewed before it expires. Certbot can automatically renew the certificate in the background, but you may need to take steps to enable that functionality. See https://certbot.org/renewal-setup for instructions.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

If you like Certbot, please consider supporting our work by:

 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate

 * Donating to EFF:                    https://eff.org/donate-le

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Reloading certificates

/config/etc/letsencrypt/renewal-hooks/deploy/20-reload: line 7: docker: command not found

/config/etc/letsencrypt/renewal-hooks/deploy/20-reload: line 12: docker: command not found

New certificate generated; starting nginx

The cert does not expire within the next day. Letting the cron script handle the renewal attempts.

**** Applying the SWAG dashboard mod... ****

**** installing docker and docker compose ****

Copying over docker and docker-compose binaries

**** Adding goaccess to package install list ****

**** libmaxminddb already installed, skipping ****

**** Applied the SWAG dashboard mod ****

[pkg-install-init] **** Installing all mod packages ****

(1/1) Installing goaccess (1.10.2-r0)

Executing busybox-1.37.0-r31.trigger

OK: 219.2 MiB in 219 packages

[custom-init] No custom files found, skipping...

Auto-reload: Watching the following folders for changes to .conf files:

/config/nginx
主要语言
Dockerfile
星标
3.8k
派生
274
平均合并
25 分钟
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

linuxserver/docker-swag 的其他 Issue

查看 linuxserver/docker-swag 的全部 Issue

相似的 Issue

更多 DevOps Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。