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

✨ Enhancement: Update on Dockerfile Implementation for Windows Users #1196

Open
Adi-204 opened this issue Dec 22, 2024 · 17 comments · Fixed by #1204 · May be fixed by #1245
Open

✨ Enhancement: Update on Dockerfile Implementation for Windows Users #1196

Adi-204 opened this issue Dec 22, 2024 · 17 comments · Fixed by #1204 · May be fixed by #1245
Assignees
Labels
✨ Enhancement Indicates that the issue suggests an improvement or new feature. Status: In Progress This issue is being worked on, and has someone assigned.

Comments

@Adi-204
Copy link
Contributor

Adi-204 commented Dec 22, 2024

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 Adi-204 added Status: Triage This is the initial status for an issue that requires triage. ✨ Enhancement Indicates that the issue suggests an improvement or new feature. labels Dec 22, 2024
Copy link

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.

@benjagm
Copy link
Collaborator

benjagm commented Dec 23, 2024

Thanks for this proposal. Please go ahead with it.

@benjagm benjagm added Status: In Progress This issue is being worked on, and has someone assigned. and removed Status: Triage This is the initial status for an issue that requires triage. labels Dec 23, 2024
@Relequestual
Copy link
Member

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?

@Adi-204
Copy link
Contributor Author

Adi-204 commented Dec 23, 2024

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 ?

@abhayymishraa
Copy link
Contributor

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
Copy link
Contributor

heyy @Relequestual can i work on this issue??

@Relequestual
Copy link
Member

heyy @Relequestual can i work on this issue??

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

@Adi-204
Copy link
Contributor Author

Adi-204 commented Dec 27, 2024

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.

@AQIB-NAWAB
Copy link

@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

@Adi-204
Copy link
Contributor Author

Adi-204 commented Dec 28, 2024

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

@aialok
Copy link
Member

aialok commented Dec 29, 2024

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.

@Adi-204
Copy link
Contributor Author

Adi-204 commented Dec 29, 2024

So what is the next plan should we move towards Volta or my earlier PR #1204 can be merged or any changes in PR can you please review and provide feedback.

@AQIB-NAWAB
Copy link

@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

@abhayymishraa
Copy link
Contributor

@Adi-204 can i work on it?

@Adi-204
Copy link
Contributor Author

Adi-204 commented Dec 29, 2024

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.

@abhayymishraa
Copy link
Contributor

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

@abhayymishraa
Copy link
Contributor

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

@DhairyaMajmudar DhairyaMajmudar marked this as a duplicate of #831 Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Enhancement Indicates that the issue suggests an improvement or new feature. Status: In Progress This issue is being worked on, and has someone assigned.
Projects
None yet
6 participants