dunglas / frankenphp

🧟 The modern PHP app server
https://frankenphp.dev
MIT License
6.38k stars 206 forks source link

docker build fail with caddy-builder #641

Closed Lucyfurnice closed 4 months ago

Lucyfurnice commented 4 months ago

What happened?

use caddy2.7.6-builder docker image

include github.com/dunglas/frakenphp/caddy build fail try include github.com/dunglas/frakenphp/caddy@1.1.0 build fail try include github.com/dunglas/frakenphp/caddy@1.0.3 build fail try include github.com/dunglas/frakenphp/caddy@1.0.0 build fail

Build Type

Docker ubuntu 22.04

Worker Mode

Yes

Operating System

GNU/Linux

CPU Architecture

x86_64

Docker configuration

#syntax=docker/dockerfile:1
FROM caddy:2.7.6-builder AS builder
RUN xcaddy build v2.7.6 --with github.com/abiosoft/caddy-exec \
--with github.com/baldinof/caddy-supervisor \
--with github.com/dunglas/frankenphp/caddy@v1.0.0 \

--with github.com/caddyserver/cache-handler \
--with github.com/aksdb/caddy-cgi/v2@v2.2.0 \
--with github.com/greenpau/caddy-git \
--with github.com/Elegant996/scgi-transport \
--with github.com/mholt/caddy-l4 \
--with github.com/caddy-dns/cloudflare \
--with github.com/greenpau/caddy-security \
--with github.com/greenpau/caddy-trace \
--with github.com/caddyserver/jsonc-adapter \
--with github.com/kadeessh/kadeessh@v0.0.2 \
--with github.com/caddyserver/transform-encoder
FROM caddy:2.7.6
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
RUN

Relevant log output

=> [builder 2/2] RUN xcaddy build v2.7.6 --with github.com/abiosoft/caddy-exec --with...  214.4s
 => => # # github.com/dunglas/frankenphp
 => => # /go/pkg/mod/github.com/dunglas/frankenphp@v1.0.0/request_options.go:10:28: undefined: FrankenPHPContext
 => => # /go/pkg/mod/github.com/dunglas/frankenphp@v1.0.0/request_options.go:20:17: undefined: FrankenPHPContext
 => => # /go/pkg/mod/github.com/dunglas/frankenphp@v1.0.0/request_options.go:48:17: undefined: FrankenPHPContext
 => => # /go/pkg/mod/github.com/dunglas/frankenphp@v1.0.0/request_options.go:58:17: undefined: FrankenPHPContext
 => => # /go/pkg/mod/github.com/dunglas/frankenphp@v1.0.0/request_options.go:67:17: undefined: FrankenPHPContext
dunglas commented 4 months ago

You need to enable cgo as documented here: https://frankenphp.dev/docs/compile/#using-xcaddy

Lucyfurnice commented 4 months ago

oops! Thankyou. It's been a while since I've manually built caddy, because xcaddy is very nice, and the last time on WSL (October 23) it worked.