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

workspace cannot clone nvm #2677

Open
orangbus opened this issue Aug 10, 2020 · 6 comments
Open

workspace cannot clone nvm #2677

orangbus opened this issue Aug 10, 2020 · 6 comments
Labels

Comments

@orangbus
Copy link

when i run docker-compose up -d workspace,i cannot curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh and `` ,it tip me

Cloning into '/home/laradock/.nvm'...
fatal: unable to access 'https://github.com/creationix/nvm.git/': Failed to connect to github.com port 443: Connection timed out
Failed to clone nvm repo. Please report this!

but ,in my terminal i can run successful , so i can`t solve it.

@carveybunt
Copy link

carveybunt commented Dec 17, 2020

Aha, I had the problem also. Bro, your issue had solved? Friends of Yunnan. I come from Guizhou.

@orangbus
Copy link
Author

I edited the workspace below the docker. Yml file, first of all, I put the https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh download this file first, and then copy to the workspace container, to build the workspace can, if you still can't start to succeed, you can consider import, need image can contact me,You can refer to my blog processing methods: http://doc.orangbus.cn/Docker/

@carveybunt
Copy link

@orangbus #2459 (comment)
Use the way, it's so easy.

@SilvaQ
Copy link

SilvaQ commented Dec 29, 2020

Chinese ali cloud server because raw.githubusercontent.com don't have access to cause the failure of the clone NVM, I was solved this problem by adjusting the DockerFile file, if your problem in the same way as I hope this will be helpful to you.

My solution is to get the IP of the disabled domain name through the IPAddress site, and provide the domain name resolution locally to point to the corresponding IP.

However, this can only be done by root, and the laradock account will report sudo problem, so I first used root to adjust and pull the resource, and finally modified the resource information into the information of laradock host

image

the code in docker file :

USER root

ENV NVM_DIR /home/laradock/.nvm

RUN echo "199.232.96.133 githubusercontent.com">>/etc/hosts \
  && echo "199.232.96.133 raw.githubusercontent.com"  >>/etc/hosts\
  && mkdir -p $NVM_DIR  \
  && curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \
  && chown laradock.laradock $NVM_DIR 

USER laradock
RUN if [ ${INSTALL_NODE} = true ]; then \
  # Install nvm (A Node Version Manager)
  . $NVM_DIR/nvm.sh \
  && nvm install ${NODE_VERSION} \
  && nvm use ${NODE_VERSION} \
  && nvm alias ${NODE_VERSION} \
  && npm config set fetch-retries ${NPM_FETCH_RETRIES} \
  && npm config set fetch-retry-factor ${NPM_FETCH_RETRY_FACTOR} \
  && npm config set fetch-retry-mintimeout ${NPM_FETCH_RETRY_MINTIMEOUT} \
  && npm config set fetch-retry-maxtimeout ${NPM_FETCH_RETRY_MAXTIMEOUT} \
  && if [ ${NPM_REGISTRY} ]; then \
  npm config set registry ${NPM_REGISTRY} \
  ;fi \
  && if [ ${INSTALL_NPM_GULP} = true ]; then \
  npm install -g gulp \
  ;fi \
  && if [ ${INSTALL_NPM_BOWER} = true ]; then \
  npm install -g bower \
  ;fi \
  && if [ ${INSTALL_NPM_VUE_CLI} = true ]; then \
  npm install -g @vue/cli \
  ;fi \
  && if [ ${INSTALL_NPM_ANGULAR_CLI} = true ]; then \
  npm install -g @angular/cli \
  ;fi \
  && ln -s `npm bin --global` /home/laradock/.node-bin \
  ;fi

@orangbus
Copy link
Author

Chinese ali cloud server because raw.githubusercontent.com don't have access to cause the failure of the clone NVM, I was solved this problem by adjusting the DockerFile file, if your problem in the same way as I hope this will be helpful to you.

My solution is to get the IP of the disabled domain name through the IPAddress site, and provide the domain name resolution locally to point to the corresponding IP.

However, this can only be done by root, and the laradock account will report sudo problem, so I first used root to adjust and pull the resource, and finally modified the resource information into the information of laradock host

image

the code in docker file :

USER root

ENV NVM_DIR /home/laradock/.nvm

RUN echo "199.232.96.133 githubusercontent.com">>/etc/hosts \
  && echo "199.232.96.133 raw.githubusercontent.com"  >>/etc/hosts\
  && mkdir -p $NVM_DIR  \
  && curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \
  && chown laradock.laradock $NVM_DIR 

USER laradock
RUN if [ ${INSTALL_NODE} = true ]; then \
  # Install nvm (A Node Version Manager)
  . $NVM_DIR/nvm.sh \
  && nvm install ${NODE_VERSION} \
  && nvm use ${NODE_VERSION} \
  && nvm alias ${NODE_VERSION} \
  && npm config set fetch-retries ${NPM_FETCH_RETRIES} \
  && npm config set fetch-retry-factor ${NPM_FETCH_RETRY_FACTOR} \
  && npm config set fetch-retry-mintimeout ${NPM_FETCH_RETRY_MINTIMEOUT} \
  && npm config set fetch-retry-maxtimeout ${NPM_FETCH_RETRY_MAXTIMEOUT} \
  && if [ ${NPM_REGISTRY} ]; then \
  npm config set registry ${NPM_REGISTRY} \
  ;fi \
  && if [ ${INSTALL_NPM_GULP} = true ]; then \
  npm install -g gulp \
  ;fi \
  && if [ ${INSTALL_NPM_BOWER} = true ]; then \
  npm install -g bower \
  ;fi \
  && if [ ${INSTALL_NPM_VUE_CLI} = true ]; then \
  npm install -g @vue/cli \
  ;fi \
  && if [ ${INSTALL_NPM_ANGULAR_CLI} = true ]; then \
  npm install -g @angular/cli \
  ;fi \
  && ln -s `npm bin --global` /home/laradock/.node-bin \
  ;fi

thank you , I solved it in a different way,First, I run on the server where Laradock can be installed, then I use docker save-o imageName.tar and docker load-I imagename.tar successfully.

@zlanich
Copy link

zlanich commented Jun 3, 2023

I was struggling with this too, and the following issue and @orangbus's response ultimately fixed it: #3328

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

No branches or pull requests

5 participants