dunglas/frankenphp

Error on startup : error while loading shared libraries: libwatcher-c.so.0: cannot open shared object file

Closed this issue · 4 comments

What happened?

I tried rebuilding a docker image this morning, i get this error when starting it : frankenphp: error while loading shared libraries: libwatcher-c.so.0: cannot open shared object file: No such file or directory

It's using a builder to add souin, following the instructions from api platform's docs ( https://api-platform.com/docs/main/core/performance/ ) :

FROM dunglas/frankenphp:builder-php8.3 AS builder
COPY --from=caddy:builder /usr/bin/xcaddy /usr/bin/xcaddy

RUN apt-get update && apt-get install --no-install-recommends -y git

ENV CGO_ENABLED=1 XCADDY_SETCAP=1 XCADDY_GO_BUILD_FLAGS="-ldflags \"-w -s -extldflags '-Wl,-z,stack-size=0x80000'\""
RUN xcaddy build \
    --output /usr/local/bin/frankenphp \
    --with github.com/dunglas/frankenphp=./ \
    --with github.com/dunglas/frankenphp/caddy=./caddy/ \
    --with github.com/dunglas/mercure/caddy \
    --with github.com/dunglas/vulcain/caddy \
    --with github.com/dunglas/caddy-cbrotli \
    --with github.com/darkweak/souin/plugins/caddy \
    --with github.com/darkweak/storages/otter/caddy

FROM dunglas/frankenphp:1.2.5-php8.3 AS frankenphp_upstream
COPY --from=builder --link /usr/local/bin/frankenphp /usr/local/bin/frankenphp

[...]

An update from caddy:builder maybe?

Build Type

Docker (Debian Bookworm)

Worker Mode

No

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

Not relevant AFAIK - and can't include it since the container doesn't start anyway.

Relevant log output

No response

The same exact Dockerfile produced a working image yesterday and i can't pinpoint which component got updated here...

It seems like adding COPY --from=builder --link /usr/local/lib/libwatcher* /usr/local/lib does the trick. I'm still not sure where the change comes from though.

It's because we released version 1.3. Be sure to use the same version for both the builder image and the final image.

Changing FROM dunglas/frankenphp:1.2.5-php8.3 AS frankenphp_upstream to FROM dunglas/frankenphp:php8.3 AS frankenphp_upstream should fix the issue.

hadn't noticed version 1.3 this morning, thanks!