Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building docker image on Windows 11 #1705

Open
clabnet opened this issue Jan 14, 2025 · 5 comments
Open

Error building docker image on Windows 11 #1705

clabnet opened this issue Jan 14, 2025 · 5 comments

Comments

@clabnet
Copy link

clabnet commented Jan 14, 2025

Hi,
this command goes on error on Windows 11 using encore v.1.45.6
encore build docker --config infra.config.json drizzle_test:0.0.1

PS D:\Weblabs\nodejs\ENCORE\drizzle-sample> encore build docker --config infra.config.json drizzle_test:0.0.1
1:20PM INF compiling Encore application for linux/amd64
1:20PM INF Downloading linux/amd64 encore-runtime.node
1:20PM INF resolving base image node:slim
1:20PM INF could not get image from local daemon, fetching it remotely
1:20PM INF saving remote image node:slim to local docker daemon
1:20PM INF saved remote image to local docker daemon
1:20PM ERR build docker image: build image fs: bundle source: add file: archive/tar: unknown file mode ?rw-rw-rw-
PS D:\Weblabs\nodejs\ENCORE\drizzle-sample> 
@fredr
Copy link
Member

fredr commented Jan 14, 2025

Could you try deleting node_modules and re-installing them?

The error indicates that there is a windows junction somewhere, we should improve that error message.

If re-installing node_modules doesn't help, could you post your package.json and check if there are any other junctions in your app dir (probably within node_modules would be my guess)?

@clabnet
Copy link
Author

clabnet commented Jan 14, 2025

Same problem. Can be because I use "pnpm" and not "npm" ?

@fredr
Copy link
Member

fredr commented Jan 14, 2025

It could be related to pnpm somehow, but could you try listing the content of node_modules with:

ls node_modules | select name, target, linktype

and see if LinkType comes out with the value Junction for anything?
what are those things and what do they point to?

@clabnet
Copy link
Author

clabnet commented Jan 14, 2025

This is the output of the required command

----          ------                                                                                                                              --------
.bin
.pnpm
@types
drizzle-kit   D:\Weblabs\nodejs\ENCORE\drizzle-sample\node_modules\.pnpm\[email protected]\node_modules\drizzle-kit\                             Junction
drizzle-orm   D:\Weblabs\nodejs\ENCORE\drizzle-sample\node_modules\.pnpm\[email protected]_@[email protected][email protected]\node_modules\drizzle-orm\ Junction
encore.dev    D:\Weblabs\nodejs\ENCORE\drizzle-sample\node_modules\.pnpm\[email protected]\node_modules\encore.dev\                               Junction
pg            D:\Weblabs\nodejs\ENCORE\drizzle-sample\node_modules\.pnpm\[email protected]\node_modules\pg\                                               Junction
typescript    D:\Weblabs\nodejs\ENCORE\drizzle-sample\node_modules\.pnpm\[email protected]\node_modules\typescript\                                Junction
.modules.yaml

PS D:\Weblabs\nodejs\ENCORE\drizzle-sample>

@fredr
Copy link
Member

fredr commented Jan 14, 2025

The problem is that the tar package of golangs stdlib that we use to create a tarball doesnt support windows junctions, and I assume here that pnpm defaults to creating junctions rather than symbolic links, and that that is the problem here.

Could you try to enable developer mode in windows:
Settings -> Update & Security -> For developers > Developer Mode > On

That will permit the creation of Symbolic Links, the try to remove node_modules again and run pnpm install (or whichever command you use to install all dependencies), and hopefully the links will be created as symbolic links instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants