website icon indicating copy to clipboard operation
website copied to clipboard

✨ Enhancement: Update on Dockerfile Implementation for Windows Users

Open Adi-204 opened this issue 1 year ago • 18 comments

Is your feature request related to a problem? Please describe

The current implementation of our Dockerfile, particularly for Windows users.

Key Issues:

  1. 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.

  2. 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

Adi-204 avatar Dec 22 '24 18:12 Adi-204

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.

github-actions[bot] avatar Dec 22 '24 18:12 github-actions[bot]

Thanks for this proposal. Please go ahead with it.

benjagm avatar Dec 23 '24 09:12 benjagm

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?

Relequestual avatar Dec 23 '24 16:12 Relequestual

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 ?

Adi-204 avatar Dec 23 '24 16:12 Adi-204

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?

abhayymishraa avatar Dec 26 '24 15:12 abhayymishraa

heyy @Relequestual can i work on this issue??

abhayymishraa avatar Dec 27 '24 09:12 abhayymishraa

heyy @Relequestual can i work on this issue??

Thanks for your interest, but the issue is already assigned.

Relequestual avatar Dec 27 '24 09:12 Relequestual

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 avatar Dec 27 '24 17:12 Adi-204

@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 image

AQIB-NAWAB avatar Dec 28 '24 11:12 AQIB-NAWAB

@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.

Adi-204 avatar Dec 28 '24 11:12 Adi-204

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.

aialok avatar Dec 29 '24 07:12 aialok

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.

Adi-204 avatar Dec 29 '24 07:12 Adi-204

@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

AQIB-NAWAB avatar Dec 29 '24 09:12 AQIB-NAWAB

@Adi-204 can i work on it?

abhayymishraa avatar Dec 29 '24 16:12 abhayymishraa

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.

Adi-204 avatar Dec 29 '24 17:12 Adi-204

@DhairyaMajmudar Could you assign me this issue ? as me and @Adi-204 alredy discussed (reference :https://json-schema.slack.com/archives/C8C4UBXDF/p1735456330251609)

abhayymishraa avatar Jan 04 '25 08:01 abhayymishraa

@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!

abhayymishraa avatar Jan 05 '25 10:01 abhayymishraa

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:

github-actions[bot] avatar Sep 07 '25 02:09 github-actions[bot]

@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.

singhaditya73 avatar Dec 12 '25 19:12 singhaditya73