diff --git a/docs/cn/docker.md b/docs/cn/docker.md index ef39aaf9..59e6933d 100644 --- a/docs/cn/docker.md +++ b/docs/cn/docker.md @@ -50,16 +50,20 @@ FROM dunglas/frankenphp:builder AS builder COPY --from=caddy:builder /usr/bin/xcaddy /usr/bin/xcaddy # 必须启用 CGO 才能构建 FrankenPHP -ENV CGO_ENABLED=1 XCADDY_SETCAP=1 XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'" -RUN xcaddy build \ - --output /usr/local/bin/frankenphp \ - --with github.com/dunglas/frankenphp=./ \ - --with github.com/dunglas/frankenphp/caddy=./caddy/ \ - --with github.com/dunglas/caddy-cbrotli \ - # Mercure 和 Vulcain 包含在官方版本中,如果不需要你可以删除它们 - --with github.com/dunglas/mercure/caddy \ - --with github.com/dunglas/vulcain/caddy - # 在此处添加额外的 Caddy 模块 +RUN CGO_ENABLED=1 \ + XCADDY_SETCAP=1 \ + XCADDY_GO_BUILD_FLAGS="-ldflags='-w -s' -tags=nobadger,nomysql,nopgx" \ + CGO_CFLAGS=$(php-config --includes) \ + CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" \ + xcaddy build \ + --output /usr/local/bin/frankenphp \ + --with github.com/dunglas/frankenphp=./ \ + --with github.com/dunglas/frankenphp/caddy=./caddy/ \ + --with github.com/dunglas/caddy-cbrotli \ + # Mercure 和 Vulcain 包含在官方版本中,如果不需要你可以删除它们 + --with github.com/dunglas/mercure/caddy \ + --with github.com/dunglas/vulcain/caddy + # 在此处添加额外的 Caddy 模块 FROM dunglas/frankenphp AS runner diff --git a/docs/docker.md b/docs/docker.md index c32a50ee..466a5cbf 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -58,16 +58,20 @@ FROM dunglas/frankenphp:builder AS builder COPY --from=caddy:builder /usr/bin/xcaddy /usr/bin/xcaddy # CGO must be enabled to build FrankenPHP -ENV CGO_ENABLED=1 XCADDY_SETCAP=1 XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'" -RUN xcaddy build \ - --output /usr/local/bin/frankenphp \ - --with github.com/dunglas/frankenphp=./ \ - --with github.com/dunglas/frankenphp/caddy=./caddy/ \ - --with github.com/dunglas/caddy-cbrotli \ - # Mercure and Vulcain are included in the official build, but feel free to remove them - --with github.com/dunglas/mercure/caddy \ - --with github.com/dunglas/vulcain/caddy - # Add extra Caddy modules here +RUN CGO_ENABLED=1 \ + XCADDY_SETCAP=1 \ + XCADDY_GO_BUILD_FLAGS="-ldflags='-w -s' -tags=nobadger,nomysql,nopgx" \ + CGO_CFLAGS=$(php-config --includes) \ + CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" \ + xcaddy build \ + --output /usr/local/bin/frankenphp \ + --with github.com/dunglas/frankenphp=./ \ + --with github.com/dunglas/frankenphp/caddy=./caddy/ \ + --with github.com/dunglas/caddy-cbrotli \ + # Mercure and Vulcain are included in the official build, but feel free to remove them + --with github.com/dunglas/mercure/caddy \ + --with github.com/dunglas/vulcain/caddy + # Add extra Caddy modules here FROM dunglas/frankenphp AS runner diff --git a/docs/fr/docker.md b/docs/fr/docker.md index fa76c7ac..386cad77 100644 --- a/docs/fr/docker.md +++ b/docs/fr/docker.md @@ -51,16 +51,20 @@ FROM dunglas/frankenphp:builder AS builder COPY --from=caddy:builder /usr/bin/xcaddy /usr/bin/xcaddy # CGO doit être activé pour construire FrankenPHP -ENV CGO_ENABLED=1 XCADDY_SETCAP=1 XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'" -RUN xcaddy build \ - --output /usr/local/bin/frankenphp \ - --with github.com/dunglas/frankenphp=./ \ - --with github.com/dunglas/frankenphp/caddy=./caddy/ \ - --with github.com/dunglas/caddy-cbrotli \ - # Mercure et Vulcain sont inclus dans la construction officielle, mais n'hésitez pas à les retirer - --with github.com/dunglas/mercure/caddy \ - --with github.com/dunglas/vulcain/caddy - # Ajoutez des modules Caddy supplémentaires ici +RUN CGO_ENABLED=1 \ + XCADDY_SETCAP=1 \ + XCADDY_GO_BUILD_FLAGS="-ldflags='-w -s' -tags=nobadger,nomysql,nopgx" \ + CGO_CFLAGS=$(php-config --includes) \ + CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" \ + xcaddy build \ + --output /usr/local/bin/frankenphp \ + --with github.com/dunglas/frankenphp=./ \ + --with github.com/dunglas/frankenphp/caddy=./caddy/ \ + --with github.com/dunglas/caddy-cbrotli \ + # Mercure et Vulcain sont inclus dans la construction officielle, mais n'hésitez pas à les retirer + --with github.com/dunglas/mercure/caddy \ + --with github.com/dunglas/vulcain/caddy + # Ajoutez des modules Caddy supplémentaires ici FROM dunglas/frankenphp AS runner diff --git a/docs/tr/docker.md b/docs/tr/docker.md index c7582862..27a3baf8 100644 --- a/docs/tr/docker.md +++ b/docs/tr/docker.md @@ -51,17 +51,20 @@ FROM dunglas/frankenphp:builder AS builder COPY --from=caddy:builder /usr/bin/xcaddy /usr/bin/xcaddy # FrankenPHP oluşturmak için CGO etkinleştirilmelidir -ENV CGO_ENABLED=1 XCADDY_SETCAP=1 XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'" -RUN xcaddy build \ - --output /usr/local/bin/frankenphp \ - --with github.com/dunglas/frankenphp=./ \ - --with github.com/dunglas/frankenphp/caddy=./caddy/ \ - --with github.com/dunglas/caddy-cbrotli \ - --with github.com/dunglas/caddy-cbrotli \ - # Mercure ve Vulcain resmi yapıya dahil edilmiştir, ancak bunları kaldırmaktan çekinmeyin - --with github.com/dunglas/mercure/caddy \ - --with github.com/dunglas/vulcain/caddy - # Buraya ekstra Caddy modülleri ekleyin +RUN CGO_ENABLED=1 \ + XCADDY_SETCAP=1 \ + XCADDY_GO_BUILD_FLAGS="-ldflags='-w -s' -tags=nobadger,nomysql,nopgx" \ + CGO_CFLAGS=$(php-config --includes) \ + CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" \ + xcaddy build \ + --output /usr/local/bin/frankenphp \ + --with github.com/dunglas/frankenphp=./ \ + --with github.com/dunglas/frankenphp/caddy=./caddy/ \ + --with github.com/dunglas/caddy-cbrotli \ + # Mercure ve Vulcain resmi yapıya dahil edilmiştir, ancak bunları kaldırmaktan çekinmeyin + --with github.com/dunglas/mercure/caddy \ + --with github.com/dunglas/vulcain/caddy + # Buraya ekstra Caddy modülleri ekleyin FROM dunglas/frankenphp AS runner