2017-04-13 8 views
0

私はangular2とdockerを使っていて、イメージを構築しようとしています。 をに入力すると、 "docker build -t angular-client:dev。"と表示されます。すべてがうまくいくようですが、 コンテナを作成しようとするときに角クライアントを起動してから、 が停止します。私はこれを理解するのに役立つことができますか?ドッカーでng-cliコンテナを作成できない

**My dockerfile** 

# Create image based on the official Node 6 image from dockerhub 
FROM node:6 

# Create a directory where our app will be placed 
RUN mkdir -p /usr/src/app 

# Change directory so that our commands run inside this new directory 
WORKDIR /usr/src/app 

# Copy dependency definitions 
COPY package.json /usr/src/app 

# Install dependecies 
RUN npm install 

# Get all the code needed to run the app 
COPY . /usr/src/app 

# Expose the port the app runs in 
EXPOSE 4200 

# Serve the app 
CMD ["npm", "start"] 


**My package.Json** 

{ 
"name": "angular-client", 
"version": "0.0.0", 
"license": "MIT", 
"angular-cli": {}, 
"scripts": { 
"start": "ng serve --host 0.0.0.0", 
"lint": "tslint \"src/**/*.ts\"", 
"test": "ng test", 
"pree2e": "webdriver-manager update", 
"e2e": "protractor" 
}, 
"private": true, 
"dependencies": { 
"@angular/common": "~2.1.0", 
"@angular/compiler": "~2.1.0", 
"@angular/core": "~2.1.0", 
"@angular/forms": "~2.1.0", 
"@angular/http": "~2.1.0", 
"@angular/platform-browser": "~2.1.0", 
"@angular/platform-browser-dynamic": "~2.1.0", 
"@angular/router": "~3.1.0", 
"core-js": "^2.4.1", 
"rxjs": "5.0.0-beta.12", 
"ts-helpers": "^1.1.1", 
"zone.js": "^0.6.23" 
}, 
"devDependencies": { 
"@types/jasmine": "^2.2.30", 
"@types/node": "^6.0.42", 
"codelyzer": "1.0.0-beta.1", 
"jasmine-core": "2.4.1", 
"jasmine-spec-reporter": "2.5.0", 
"karma": "1.2.0", 
"karma-chrome-launcher": "^2.0.0", 
"karma-cli": "^1.0.1", 
"karma-jasmine": "^1.0.2", 
"karma-remap-istanbul": "^0.2.1", 
"protractor": "4.0.9", 
"ts-node": "1.2.1", 
"tslint": "3.13.0", 
"typescript": "~2.0.3", 
"webdriver-manager": "10.2.5" 
    } 
} 

**The output coming from kitematic** 

npm info lifecycle [email protected]~start: Failed to exec start script 
npm ERR! Linux 4.4.59-boot2docker 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 
npm ERR! node v6.10.2 
npm ERR! npm v3.10.10 
npm ERR! file sh 
npm ERR! code ELIFECYCLE 
npm ERR! errno ENOENT 
npm ERR! syscall spawn 
npm ERR! [email protected] start: `ng serve --host 0.0.0.0` 
npm ERR! spawn ENOENT 
npm ERR! 
npm ERR! Failed at the [email protected] start script 'ng serve --host 
0.0.0.0'. 
npm ERR! Make sure you have the latest version of node.js and npm 
installed. 
npm ERR! If you do, this is most likely a problem with the angular-client 
package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  ng serve --host 0.0.0.0 
npm ERR! You can get information on how to open an issue for this project 
with: 
npm ERR!  npm bugs angular-client 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls angular-client 
npm ERR! There is likely additional logging output above. 
npm ERR! Please include the following file with any support request: 
npm ERR!  /usr/src/app/npm-debug.log 

答えて

0

にあなたをそこに導くことができます記録されます。私はこれが唯一の問題であるかどうかはわかりませんが、それはngがエラーを表示している原因になります。

0

"npm start"コマンドが失敗しています。 出力がkitematicから来るをチェックし、エラーが角度CLI用のdevの依存関係が欠落している問題

関連する問題