-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[New] Introduce Docker environment for nvm #1472
Conversation
This definitely belongs in a separate repo; I don't use Docker myself and can't commit to maintaining it. Separately, a docker file for developing nvm will rapidly be misused as a docker file for using nvm, and that won't be good for anybody. |
hmmm ... we still have problem on running tests locally, I believe that docker can help in this part. As |
The reason of this PR 😅 : #1339 (comment)
|
Regardless of docker or no, the tests need to be fixed so they can be run and pass locally regardless of NVM_DIR location. Also, Mac OS X is one of the most important platforms for nvm, and that can't be tested with docker; which means that id rather perfect the generic dev story before focusing on a container one. You are correct about that comment, and I appreciate the PR. I will leave it open, but do not plan to merge it in the medium term. |
I thought there is a PR trying to add MacOS test in Travis CI already, there should be no conflicts about testing on MacOS and adding Dockerfile, am I right? |
As it's for development environment usage, the docker image will be 1.3GB fat and it needs about 15 mins to be built, not thin and not quick at all, so I don't agree that it will rapidly be misused as a docker file for using nvm, it makes no sense. |
Fair points. I don't think these files need to be downloaded by users who install nvm using git, though. Can you think of a way to avoid that? |
If you wanna do that, yes, we can use sparseCheckout, and we should checkout only |
I'd prefer an exclusion list approach, rather than an inclusion list approach - git updating needs to grab new file by default, so that i can split things up into separate files in the future. Can we use sparseCheckout and check out everything except certain folders? |
Nope I don't think so. |
Then we'll need another solution, I think. |
I think we just don't need to be so afraid of misusing, should we? They have no reason to misuse it :) |
85340ca
to
ef6537d
Compare
@@ -0,0 +1,17 @@ | |||
HEAD | |||
.cache | |||
v* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about versions/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be also ignored as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh duh, because it starts with v. k
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go now?
.urchin_stdout | ||
test/**/test_output | ||
|
||
node_modules/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't docker already ignore everything in .gitignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope.
ef6537d
to
6034765
Compare
Dockerfile
Outdated
# | ||
# This is for development usage only, please not that it'll use about | ||
# 1.2 GB disk space and about 15 minutes to build this image, and this | ||
# is not a Dockerfile to build a Dockerized nvm for production usage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added notes here to remind people not to misuse it.
e03ea3d
to
5fe9e3a
Compare
btw @ljharb, I think we can update sparseCheckout in each versions' install script if you really need that, not a problem at all |
5fe9e3a
to
b416489
Compare
Actually I just found that this really really help me debug nvm problems, as it's purely isolated and I can spawn multi containers to test at the same time, which saved me many hours, hope we can give it a try, make the contribution easier for the others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What command would I run to test this out locally?
RUN echo 'export PATH="~/.cabal/bin/:${PATH}"' >> $HOME/.bashrc | ||
|
||
# nvm | ||
COPY . /home/nvm/.nvm/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is /home/nvm
a path for inside the docker image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's inside docker.
@ljharb try Use
|
b416489
to
f452ac5
Compare
Docker images published here: https://hub.docker.com/r/peterdavehello/nvm/ wtih v0.33.2 tag. |
@ljharb is there anything else I can do here? Thanks. |
Is there any value in constraining this to a |
@ljharb do you mean you're considering to put it in a |
Yes, so that docker-related files don't clutter up the main repo root. |
I'm not sure if it has some value, as we are not going to build production environment with many different base like nodejs would build with different operating systems which would need to be separated. Personally, the current status looks good enough to me. |
This should help
nvm
development and testing