✨ Enhancement: Update on Dockerfile Implementation for Windows Users
Is your feature request related to a problem? Please describe
The current implementation of our Dockerfile, particularly for Windows users.
Key Issues:
-
Incompatibility with make Command: Currently, Windows users are unable to utilize the make command within the Docker container. This limitation arises from the differences in command-line tools available on Windows compared to Unix-based systems. As a result, any build processes that rely on make will not function as intended on Windows.
-
Yarn Version Mismatch Error: Additionally, when executing standard Docker commands such as docker build and docker run, users may encounter a yarn version mismatch error. This issue occurs because the version of Yarn installed in the Docker container may differ from the version expected by the application. This discrepancy can lead to build failures and unexpected behavior during runtime.
Describe the solution you'd like
To added the corepack enable command in the Dockerfile. This adjustment ensures that the correct version of Yarn is used consistently across different environments.
Describe alternatives you've considered
No response
Additional context
No response
Are you working on this?
Yes
Welcome to the JSON Schema Community. We are so excited you are here! Thanks a lot for reporting your first issue!! 🎉🎉 Please make sure to take a look at our contributors guide if you plan on opening a pull request. For more details, check out the README.md file.
Thanks for this proposal. Please go ahead with it.
Node.js are removing corepack as of the next major release, so this will then break again if/when we upgrade major Node.js versions. Maybe by then it will matter less, but figured I'd bring it up. Maybe a preferable solution would be to use nvm or volta?
Thank you for your feedback on the pull request. I understand that Node.js plans to remove corepack in a future major release, which could lead to compatibility issues once we upgrade to newer Node.js versions. Would you recommend moving forward with nvm or Volta for managing Yarn versions in the Dockerfile, how exactly I can contribute can you please explain in detail ?
Hi @benjagm, @Relequestual, and @Adi-204, I'd like to work on this issue if it's still available. Could you please let me know if I can take it up?
heyy @Relequestual can i work on this issue??
heyy @Relequestual can i work on this issue??
Thanks for your interest, but the issue is already assigned.
I encountered an issue while attempting to install Volta in the project. The error message was as follows:
main: line 228: /root/.volta/bin/volta: cannot execute: required file not found This suggests that the Volta binary is not correctly installed or accessible in the Docker environment, likely due to incompatibilities between the environment and the Volta installation script.
After researching the issue, I found a potential solution: Volta may not fully support Alpine Linux due to its use of musl libc. A recommended workaround is to switch to a glibc-based base image, such as node:20-slim, instead of node:20-alpine. While this increases the image size, it improves compatibility with tools like Volta.
This solution is working perfectly fine on Windows. Should I proceed with raising a PR for this change, or do we need to explore alternative solutions?
Looking forward to your guidance.
@Adi-204 I'm also getting error while setup the project using docker. I'm currently at linux Ubuntu , if you can solve this problem that will be really great as you are already assigned to this issue
Here is picture
@AQIB-NAWAB I raise the PR https://github.com/json-schema-org/website/pull/1204 you can see that I added 1 line dockerfile related to corepack-enable and then run below 3 commands - docker build -t app . docker run --rm -it -v "${PWD}:/app" app sh -c "yarn install" docker run --rm -it -v "${PWD}:/app" -p 3000:3000 app
If you are trying to build using make command I don't have much idea because I am on windows. You can maybe add corepack in dockerfile and then run above 3 commands for now we will soon replace corepack with Volta.
Node.js are removing corepack as of the next major release, so this will then break again if/when we upgrade major Node.js versions. Maybe by then it will matter less, but figured I'd bring it up. Maybe a preferable solution would be to use nvm or volta?
Please checkout this thread we had a discussion earlier: https://json-schema.slack.com/archives/C8C4UBXDF/p1723977903364329?thread_ts=1723039141.930599&cid=C8C4UBXDF
Corepack is being removed from Node.js but will be maintained separately. Once all of the above is complete, Corepack will be removed from the Node.js distribution starting with the next major release. Users who wish to continue using Corepack can do so by following the instructions available on the Node.js download page or in Corepack's documentation. This change will reduce the maintenance burden on the Node.js project and allow Corepack to evolve independently.
Corepack will be still available just it get removed from node js default and corepack will be maintain separately.
So what is the next plan should we move towards Volta or my earlier PR https://github.com/json-schema-org/website/pull/1204 can be merged or any changes in PR can you please review and provide feedback.
@AQIB-NAWAB I raise the PR #1204 you can see that I added 1 line dockerfile related to corepack-enable and then run below 3 commands - docker build -t app . docker run --rm -it -v "${PWD}:/app" app sh -c "yarn install" docker run --rm -it -v "${PWD}:/app" -p 3000:3000 app
If you are trying to build using make command I don't have much idea because I am on windows. You can maybe add corepack in dockerfile and then run above 3 commands for now we will soon replace corepack with Volta.
okk i'll try to resolve the it
@Adi-204 can i work on it?
https://json-schema.slack.com/archives/C8C4UBXDF/p1735458678484549?thread_ts=1735456330.251609&cid=C8C4UBXDF
If you still want to solve raise PR and mention it. They might approve if your solution feels right.
@DhairyaMajmudar Could you assign me this issue ? as me and @Adi-204 alredy discussed (reference :https://json-schema.slack.com/archives/C8C4UBXDF/p1735456330251609)
@Relequestual I've tested the changes thoroughly on both Windows and Linux environments and confirmed everything is working as expected without corepack. Please review when you have a chance, and I'm happy to make any adjustments if needed. Thanks!
Hello! :wave:
This issue has been automatically marked as stale due to inactivity :sleeping:
It will be closed in 180 days if no further activity occurs. To keep it active, please add a comment with more details.
There can be many reasons why a specific issue has no activity. The most probable cause is a lack of time, not a lack of interest.
Let us figure out together how to push this issue forward. Connect with us through our slack channel : https://json-schema.org/slack
Thank you for your patience :heart:
@benjagm @Relequestual The issue has been quiet for a couple of weeks now; if it’s still considered open, could you please assign #1196 to me? I’d like to carry the Windows-Dockerfile work forward and get it merged.