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

Docker build fails to yarn install #99

Closed
icarito opened this issue Mar 29, 2018 · 5 comments
Closed

Docker build fails to yarn install #99

icarito opened this issue Mar 29, 2018 · 5 comments

Comments

@icarito
Copy link
Member

icarito commented Mar 29, 2018

After having built, examining the container, no node_modules directory is found.

There is a strange message about not having connection, also during build stage.

Worked around this by running yarn from Docker host.

icarito@tycho:/srv/plotsbot/plotsbot$ docker-compose up -d
Creating network "plotsbot_default" with the default driver
Creating plotsbot_plotsbot_1 ... 
Creating plotsbot_plotsbot_1 ... done
icarito@tycho:/srv/plotsbot/plotsbot$ docker-compose ps
       Name            Command     State    Ports 
-------------------------------------------------
plotsbot_plotsbot_1   yarn start   Exit 1         
icarito@tycho:/srv/plotsbot/plotsbot$ docker-compose logs plotsbot
Attaching to plotsbot_plotsbot_1
plotsbot_1  | yarn run v1.2.1
plotsbot_1  | warning You don't appear to have an internet connection. Try the --offline flag to use the cache for registry queries.
plotsbot_1  | $ node .
plotsbot_1  | module.js:538
plotsbot_1  |     throw err;
plotsbot_1  |     ^
plotsbot_1  | 
plotsbot_1  | Error: Cannot find module 'github'
plotsbot_1  |     at Function.Module._resolveFilename (module.js:536:15)
plotsbot_1  |     at Function.Module._load (module.js:466:25)
plotsbot_1  |     at Module.require (module.js:579:17)
plotsbot_1  |     at require (internal/module.js:11:18)
plotsbot_1  |     at Object.<anonymous> (/usr/src/app/src/bot.js:2:16)
plotsbot_1  |     at Module._compile (module.js:635:30)
plotsbot_1  |     at Object.Module._extensions..js (module.js:646:10)
plotsbot_1  |     at Module.load (module.js:554:32)
plotsbot_1  |     at tryModuleLoad (module.js:497:12)
plotsbot_1  |     at Function.Module._load (module.js:489:3)
plotsbot_1  | error Command failed with exit code 1.
plotsbot_1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
icarito@tycho:/srv/plotsbot/plotsbot$ 

Still opened issue to keep track and fix! Thanks!

@icarito
Copy link
Member Author

icarito commented Mar 29, 2018

Here's the build log with the connection error:

icarito@tycho:/srv/plotsbot/plotsbot$ docker-compose build --pull                                                                                              
Building plotsbot
Step 1/8 : FROM node:8.9.0-stretch
8.9.0-stretch: Pulling from library/node
Digest: sha256:28b784e1f97374a971af390dcbaf53a55d180fac1868023237818c27af7365a0
Status: Image is up to date for node:8.9.0-stretch
 ---> 636afef734fb
Step 2/8 : WORKDIR /usr/src/app
 ---> Using cache
 ---> cead526fff33
Step 3/8 : COPY package.json yarn.lock ./
 ---> 9695a2e6d943
Removing intermediate container 7998c8ed5dee
Step 4/8 : RUN yarn install --production
 ---> Running in e117e95df6d4
yarn install v1.2.1
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...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 9.68s.
 ---> 0e8ab026700c
Removing intermediate container e117e95df6d4
Step 5/8 : COPY . .
 ---> 1218ac0e5724
Removing intermediate container b12a7ea06b38
Step 6/8 : RUN cp -n ./config.json.sample ./config.json
 ---> Running in 925a7292abe7
 ---> db220012bb12
Removing intermediate container 925a7292abe7
Step 7/8 : EXPOSE 4000
 ---> Running in faea3a989086
 ---> 71e135776c4c
Removing intermediate container faea3a989086
Step 8/8 : CMD yarn start
 ---> Running in 332d11f88a31
 ---> c4d5a3272c63
Removing intermediate container 332d11f88a31
Successfully built c4d5a3272c63
Successfully tagged plotsbot_plotsbot:latest
icarito@tycho:/srv/plotsbot/plotsbot$ 

@pdurbin
Copy link
Contributor

pdurbin commented May 1, 2018

While working on pull request #110 last night I used Docker to test my changes and it worked fine. @icarito are you still having this problem? I should mention that I'm not very good and Docker and didn't even notice the docker-compose file. I was running docker build -t pb1 -f Dockerfile . not because it's better but because it worked. 😄

@grvsachdeva
Copy link
Member

Please update the issue if any changes have been made. Thanks!

cc @icarito @jywarren @pdurbin

@icarito
Copy link
Member Author

icarito commented Feb 3, 2019

Thanks for unburying this one. We're not seeing this anymore, possibly from DNS fixes in Tycho.

@icarito icarito closed this as completed Feb 3, 2019
@grvsachdeva
Copy link
Member

Great!

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

No branches or pull requests

3 participants