Skip to content

Unable to build static binary with relative path #2092

@kranack

Description

@kranack

What happened?

Since the v1.10.0 I cannot build a static binary if the value of EMBED env variable is a relative path.

I guess the test with -n option doesn't work with relative folder path.

if [ -n "${EMBED}" ] && [ -d "${EMBED}" ]; then

Here's a sample working with v1.9.0:

FROM --platform=linux/amd64 dunglas/frankenphp:static-builder-gnu-1.9

# Copy your app
WORKDIR /go/src/app/dist/app
COPY . .

# Build the static binary
WORKDIR /go/src/app/
RUN EMBED=dist/app/ ./build-static.sh

Since v1.10.0, I have to pass an absolute path to EMBED otherwise the binary doesn't include the content of my app:

FROM --platform=linux/amd64 dunglas/frankenphp:static-builder-gnu-1.10

# Copy your app
WORKDIR /go/src/app/dist/app
COPY . .

# Build the static binary
WORKDIR /go/src/app/
RUN EMBED=/go/src/app/dist/app ./build-static.sh

Build Type

Static binary

Worker Mode

Yes

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

Docker image: dunglas/frankenphp:static-builder-gnu
Static parameters:
PHP_EXTENSIONS=amqp,brotli,bz2,ctype,curl,dom,fileinfo,filter,iconv,intl,ldap,libxml,lz4,pdo_sqlite,session,sodium,sqlite3,ssh2,tokenizer,xml,xmlreader,xmlwriter,xz,zip,zlib,zstd

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions