Docker-node: Using yarn in node:6.10.0 got warning You don't appear to have an internet connection

Created on 7 Mar 2017  路  6Comments  路  Source: nodejs/docker-node

Using image node:6.10.0
when run yarn, got the warning "You don't appear to have an internet connection",
and the process was blocked there and retried for a long time, but finally the installation process failed.
I trie many times, all the same.

yarn

Most helpful comment

Update test result as following:

1) build an intermediate image first manually
in this image, including 'RUN npm install -g pm2 node-gyp', the building process completed successfully.

2) build the target image using the intermediate one built at step1
When running 'yarn', I still got that warning, but this time the building completed successfully.
Step 7/9 : RUN yarn
---> Running in 7dbcdcfcb8b9
yarn install v0.21.3
warning You don't appear to have an internet connection. Try the --offline flag to use the cache for registry queries.
[1/4] Resolving packages...
[2/4] Fetching packages...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 450.00s.


I worked it out finally. However I still don't know why the preview tryouts all failed when I was trying to build the target image directly.
Fragments from the previous Dockerfile:
FROM node:6.10.0
WORKDIR .......
RUN npm install -g pm2
ADD .........
RUN yarn

One of the major difference is to install node-gyp globally, but in the preview tryouts, node-gyp is installed inside project.

All 6 comments

That doesn't sound so good. However, I think this should first be posted to the yarn issue tracker, as it might be somewhat related to yarnpkg/yarn#746

Also, you need to provide more information as to what plattform you are running this on as well as any configurations and command run that resulted in this problem.

The docker environment is running on CentOS7. Yarn works fine in pure system, but only show that warning in docker.

Does npm work as normal inside the Docker container under the same conditions?

Update test result as following:

1) build an intermediate image first manually
in this image, including 'RUN npm install -g pm2 node-gyp', the building process completed successfully.

2) build the target image using the intermediate one built at step1
When running 'yarn', I still got that warning, but this time the building completed successfully.
Step 7/9 : RUN yarn
---> Running in 7dbcdcfcb8b9
yarn install v0.21.3
warning You don't appear to have an internet connection. Try the --offline flag to use the cache for registry queries.
[1/4] Resolving packages...
[2/4] Fetching packages...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 450.00s.


I worked it out finally. However I still don't know why the preview tryouts all failed when I was trying to build the target image directly.
Fragments from the previous Dockerfile:
FROM node:6.10.0
WORKDIR .......
RUN npm install -g pm2
ADD .........
RUN yarn

One of the major difference is to install node-gyp globally, but in the preview tryouts, node-gyp is installed inside project.

It appears to be related to this http://stackoverflow.com/questions/40186104/yarn-warning-on-docker-build. Either we need to patch yarn not to check interfaces or add a flag to ignore the check for online connectivity temporarily.

Closing as a yarn issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamwillbar picture iamwillbar  路  4Comments

dionysiusmarquis picture dionysiusmarquis  路  3Comments

linux17kartik picture linux17kartik  路  4Comments

NodeGuy picture NodeGuy  路  4Comments

eyaylagul picture eyaylagul  路  3Comments