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 container doesn't build #1153

Closed
japrogramer opened this issue Jun 24, 2017 · 11 comments
Closed

Docker container doesn't build #1153

japrogramer opened this issue Jun 24, 2017 · 11 comments

Comments

@japrogramer
Copy link

japrogramer commented Jun 24, 2017

  • I'm submitting a ...
    [ X] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository

  • Do you want to request a feature or report a bug?
    Hello i would like to report a bug

  • What is the current behavior?
    current behavior is that it crashes while building the docker container

Sending build context to Docker daemon  31.42MB

Step 1/5 : FROM node:6.9.5
 ---> cde8ba396275
Step 2/5 : RUN git clone https://github.com/akveo/ng2-admin.git /var/www     && cd /var/www     && npm install --global rimraf     && npm run clean     && npm install --global webpack webpack-dev-server [email protected]     && npm install     && npm run prebuild:prod && npm run build:prod
 ---> Running in 440408a62808
�[91mCloning into '/var/www'...
�[0m�[91mnpm�[0m�[91m info�[0m�[91m it worked if it ends with ok
�[0m�[91mnpm info using [email protected]
npm info using [email protected]
�[0m�[91mnpm info attempt registry request try #1 at 7:55:21 PM
�[0m�[91mnpm http request GET https://registry.npmjs.org/rimraf
�[0m�[91mnpm http 200 https://registry.npmjs.org/rimraf
�[0m�[91mnpm info addNameTag [ 'rimraf', 'latest' ]
�[0m�[91mnpm info retry fetch attempt 1 at 7:55:22 PM
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
�[0m�[91mnpm http fetch GET https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz
�[0m�[91mnpm http �[0m�[91mfetch 200 https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
�[0m�[91mnpm http request GET https://registry.npmjs.org/glob
�[0m�[91mnpm http 200 https://registry.npmjs.org/glob
�[0m�[91mnpm info retry fetch attempt 1 at 7:55:22 PM
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
�[0m�[91mnpm http fetch GET https://registry.npmjs.org/glob/-/glob-7.1.2.tgz
�[0m�[91mnpm http fetch 200 https://registry.npmjs.org/glob/-/glob-7.1.2.tgz
�[0m�[91mnpm info �[0m�[91mattempt�[0m�[91m registry request try #1 at 7:55:22 PM
�[0m�[91mnpm http request GET https://registry.npmjs.org/fs.realpath
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
�[0m�[91mnpm http �[0m�[91mrequest�[0m�[91m GET https://registry.npmjs.org/inflight
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
�[0m�[91mnpm http request GET https://registry.npmjs.org/inherits
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm http request GET https://registry.npmjs.org/minimatch
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm http request GET https://registry.npmjs.org/once
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm http request GET https://registry.npmjs.org/path-is-absolute
�[0m�[91mnpm http 200 https://registry.npmjs.org/fs.realpath
�[0m�[91mnpm info retry fetch attempt 1 at 7:55:22 PM
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm http fetch GET https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz
�[0m�[91mnpm http fetch 200 https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz
�[0m�[91mnpm http 200 https://registry.npmjs.org/inflight
�[0m�[91mnpm http 200�[0m�[91m https://registry.npmjs.org/inherits
�[0m�[91mnpm info retry fetch attempt 1 at 7:55:22 PM
npm�[0m�[91m info attempt registry request try #1 at 7:55:22 PM
�[0m�[91mnpm �[0m�[91mhttp�[0m�[91m fetch GET https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz
�[0m�[91mnpm http 200 https://registry.npmjs.org/once
�[0m�[91mnpm http 200 https://registry.npmjs.org/minimatch
�[0m�[91mnpm info retry fetch attempt 1 at 7:55:22 PM
npm�[0m�[91m info attempt registry request try #1 at 7:55:22 PM
�[0m�[91mnpm �[0m�[91mhttp fetch GET https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz
�[0m�[91mnpm �[0m�[91minfo�[0m�[91m �[0m�[91mretry fetch attempt 1 at 7:55:22 PM
�[0m�[91mnpm info attempt�[0m�[91m registry request try #1 at 7:55:22 PM
�[0m�[91mnpm http fetch GET https://registry.npmjs.org/once/-/once-1.4.0.tgz
�[0m�[91mnpm http 200 https://registry.npmjs.org/path-is-absolute
�[0m�[91mnpm info retry fetch attempt 1 at 7:55:22 PM
npm �[0m�[91minfo attempt registry request try #1 at 7:55:22 PM
npm�[0m�[91m http fetch GET https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz
�[0m�[91mnpm info retry fetch attempt 1 at 7:55:22 PM
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
�[0m�[91mnpm �[0m�[91mhttp fetch GET https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz
�[0m�[91mnpm http fetch 200 https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz
�[0m�[91mnpm http fetch 200 https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz
�[0m�[91mnpm http �[0m�[91mfetch 200 https://registry.npmjs.org/once/-/once-1.4.0.tgz
�[0m�[91mnpm http fetch 200 https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz
�[0m�[91mnpm http fetch 200 https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm http request GET https://registry.npmjs.org/wrappy
�[0m�[91mnpm http 200 https://registry.npmjs.org/wrappy
�[0m�[91mnpm info retry fetch attempt 1 at 7:55:22 PM
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm http fetch GET https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz
�[0m�[91mnpm http fetch 200 https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm http request GET https://registry.npmjs.org/brace-expansion
�[0m�[91mnpm http 200 https://registry.npmjs.org/brace-expansion
�[0m�[91mnpm info retry fetch attempt 1 at 7:55:22 PM
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm http fetch GET https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz
�[0m�[91mnpm http fetch 200 https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm http request GET https://registry.npmjs.org/balanced-match
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm �[0m�[91mhttp request GET https://registry.npmjs.org/concat-map
�[0m�[91mnpm http 200 https://registry.npmjs.org/concat-map
�[0m�[91mnpm http 200 https://registry.npmjs.org/balanced-match
�[0m�[91mnpm info retry fetch attempt 1 at 7:55:22 PM
npm info �[0m�[91mattempt registry request try #1 at 7:55:22 PM
npm http fetch GET https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz
�[0m�[91mnpm info�[0m�[91m retry fetch attempt 1 at 7:55:22 PM
�[0m�[91mnpm info attempt registry request try #1 at 7:55:22 PM
npm http fetch GET https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz
�[0m�[91mnpm http fetch 200 https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz
�[0m�[91mnpm http fetch 200 https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz
�[0m�[91mnpm info lifecycle [email protected]~preinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~preinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~preinstall: [email protected]
npm�[0m�[91m info lifecycle [email protected]~preinstall: [email protected]
npm�[0m�[91m info lifecycle [email protected]~preinstall: [email protected]
npm info�[0m�[91m lifecycle [email protected]~preinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~preinstall: [email protected]
npm info �[0m�[91mlifecycle [email protected]~preinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~preinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~preinstall: [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m�[91mnpm info linkStuff�[0m�[91m [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m�[91mnpm info linkStuff [email protected]
�[0m/usr/local/bin/rimraf -> /usr/local/lib/node_modules/rimraf/bin.js
�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~install: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m�[91mnpm info lifecycle [email protected]~postinstall: [email protected]
�[0m/usr/local/lib
`-- [email protected] 
  `-- [email protected] 
    +-- [email protected] 
    +-- [email protected] 
    | `-- [email protected] 
    +-- [email protected] 
    +-- [email protected] 
    | `-- [email protected] 
    |   +-- [email protected] 
    |   `-- [email protected] 
    +-- [email protected] 
    `-- [email protected] 

�[91mnpm info ok 
�[0m�[91mnpm�[0m�[91m �[0m�[91minfo it worked if it ends with ok
�[0m�[91mnpm info using [email protected]
npm info�[0m�[91m using [email protected]
�[0m�[91mnpm ERR! Linux 4.11.6-3-ARCH
�[0m�[91mnpm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "clean"
npm ERR! node v6.9.5
�[0m�[91mnpm ERR! npm  v3.10.10
�[0m�[91m
�[0m�[91mnpm�[0m�[91m ERR! missing script: clean
npm ERR!�[0m�[91m 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
�[0m�[91m
npm ERR!�[0m�[91m Please include the following file with any support request:
npm ERR!     /var/www/npm-debug.log
�[0mThe command '/bin/sh -c git clone https://github.com/akveo/ng2-admin.git /var/www     && cd /var/www     && npm install --global rimraf     && npm run clean     && npm install --global webpack webpack-dev-server [email protected]     && npm install     && npm run prebuild:prod && npm run build:prod' returned a non-zero code: 1
  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

$docker build -t ng2 .

  • What is the expected behavior?

I expect the image to be built

  • Please tell us about your environment:
    4.11.6-3-ARCH
    linux 4.11.6-3
    Docker version 17.05.0-ce, build 89658bed64
@umerebryx
Copy link

+1

@KissBalazs
Copy link

have you tried to remove the "&& npm run clean " command? It doesnt work for me either,

@phamdt
Copy link

phamdt commented Sep 27, 2017

@japrogramer are you able to share you dockerfile and .dockerignore? also have you tried this again since the recent switch from ng2-admin to ngx-admin?

@japrogramer
Copy link
Author

japrogramer commented Sep 27, 2017

well, I just did a pull and there doesn't seem to be a docker file in master.
But it was the stock docker file that came with the project at the time the issue was opened.

@phamdt
Copy link

phamdt commented Sep 28, 2017

oh i hadn't noticed that. i made my own docker file that works as long as you set host and port properly:

FROM node:8.6.0
WORKDIR /usr/src

ADD . .

RUN npm install

EXPOSE 4200
CMD npm start

@japrogramer
Copy link
Author

I tried your docker file, and it does work and it does serve .. Im probably exposing the ports incorrectly, I can not access the site from outside the container but from within the container using curl I can see that it does serve the site ..
I built with

docker build -t ngx-admin .
docker run -ti 4200:4200 ngx-admin

@phamdt
Copy link

phamdt commented Sep 28, 2017

Oh i ended up overriding the cmd since im using docker compose. Try running ng serve from bin as in node_modules/.bin/ng serve --host 0.0.0.0 --port 4200

@japrogramer
Copy link
Author

That worked! but only when accessing the site from the same computer, when I try to access the page from my laptop while running on my desktop It says.
Invalid Host header
Thanks tho, I can see that there has been some changes since last I tried this project.

@phamdt
Copy link

phamdt commented Sep 28, 2017

We can probably close this then unless maintainers want to add back andockerfile whoch incam do in a PR

@japrogramer
Copy link
Author

probably a good Idea to do a pull request now. everything seems to work, except for that invalid host header error, but that can probably be fixed later.

@omegang610
Copy link

edit package.json
"clean": "npm cache clean --force && npm run rimraf -- node_modules doc typings coverage dist",
updated npm required add --force

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

7 participants