diff --git a/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh b/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh index 5632b91e..1ec117e1 100755 --- a/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh +++ b/docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh @@ -28,7 +28,10 @@ CERT_INIT_FLAG="/opt/certbot/.ownership_initialized" if [ ! -f "$CERT_INIT_FLAG" ]; then # Prevents errors when installing python certbot plugins when non-root - chown "$PUID:$PGID" /opt/certbot /opt/certbot/bin + if [ "$SKIP_CERTBOT_OWNERSHIP" != "true" ]; then + log_info 'Changing ownership of /opt/certbot directories ...' + chown "$PUID:$PGID" /opt/certbot /opt/certbot/bin + fi # Handle all site-packages directories efficiently find /opt/certbot/lib -type d -name "site-packages" | while read -r SITE_PACKAGES_DIR; do