You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an example project using bunx create-remix <name>
bun install, bun run build, bun start work as normal
Create a fairly basic dockerfile and attempt to build
Your dockerfile may be slightly simpler than this, but here's the important lines from mine:
FROM oven/bun:1.1.8-alpine
WORKDIR"/usr/root/function"COPY [\
"./function/bun.lock*", \
"./function/package.json*", \
"./"\
]
COPY [ "./function/node_modules/", "./node_modules/" ]
RUN bun install --frozen-lockfile
COPY [ "./function/", "./" ]
RUN bun run build
The symlink is followed, the context is set to the symlink's destination directory, and the require succeeds.
What do you see instead?
The symlink is followed, the context is not set to the symlink's destination directory, and the require fails.
Additional information
I imagine you'll want to find out why the symlink doesn't appear to be followed when using a package.json script, because it seems to be working locally in Ubuntu, not sure why it works in one and not others.
I tried this using different dockerhub images, all of them had this problem. Seems like there's something I missed, or this is something specific to docker? I ran this using the built-in docker builder, and I also ran using the kubernetes docker builder. Both had this problem.
The text was updated successfully, but these errors were encountered:
kevin-lindsay-1
changed the title
Dependency resolution does not appear to follow symlinks when in a dockerfile
Dependency resolution does not appear to follow symlink context when in a dockerfile
May 14, 2024
What version of Bun is running?
1.1.8+89d25807f
What platform is your computer?
Linux 6.5.0-28-generic x86_64 x86_64
What steps can reproduce the bug?
bunx create-remix <name>
bun install
,bun run build
,bun start
work as normalYour dockerfile may be slightly simpler than this, but here's the important lines from mine:
Using this (default) build script:
References this binary, which is a symlink:
Which contains this line:
Which produces this error:
Changing the
cli.js
file to output directory information results in the symlink's directory being output:This can be worked around by supplying a path to the actual folder being executed from:
What is the expected behavior?
The symlink is followed, the context is set to the symlink's destination directory, and the
require
succeeds.What do you see instead?
The symlink is followed, the context is not set to the symlink's destination directory, and the
require
fails.Additional information
I imagine you'll want to find out why the symlink doesn't appear to be followed when using a
package.json
script, because it seems to be working locally in Ubuntu, not sure why it works in one and not others.I tried this using different dockerhub images, all of them had this problem. Seems like there's something I missed, or this is something specific to docker? I ran this using the built-in docker builder, and I also ran using the kubernetes docker builder. Both had this problem.
The text was updated successfully, but these errors were encountered: