2016-11-30 8 views
0

ドッカーコンテナを構築しようとしているときに問題が発生しました。それはThe command '/bin/sh -c grunt build' returned a non-zero code: 6Docker Container内のGruntビルドが0以外のコードを返しました:6

私はhereからチェックし、それが~/.known_hostに関連するかもしれない推測しているが生成されますが、私はまだ同じアプローチを行うことを周りに働いている

FROM ubuntu:16.04 
# ... RUN apt-get update && install ... 

EXPOSE 3005 

WORKDIR /usr/src/app 
RUN npm install forever -g && \ 
    npm install -g bower && \ 
    npm install -g grunt-cli 
COPY . . 
RUN npm install && bower install --allow-root 
RUN grunt build 

WORKDIR /usr/src/app/dist 
CMD NODE_ENV=${APP_ENV} forever start --uid "my_app" --append server/app.js 

のように私のドッキングウィンドウのファイルです。修正方法を教えてください。あなたの情報については

、ドッキングウィンドウはinjectorステップで停止し、あなたが警告を持っているので、あなたが、6ステータスコードを持ってmanual、イサキに見つけることができるように、このは

injector: { 
     options: { 

     }, 
     // Inject application script files into index.html (doesn't include bower) 
     scripts: { 
     options: { 
      transform: function(filePath) { 
      filePath = filePath.replace('/client/', ''); 
      filePath = filePath.replace('/.tmp/', ''); 
      return '<script src="' + filePath + '"></script>'; 
      }, 
      starttag: '<!-- injector:js -->', 
      endtag: '<!-- endinjector -->' 
     }, 
     files: { 
      '<%= yeoman.client %>/index.html': [ 
       ['{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js', 
       '!{.tmp,<%= yeoman.client %>}/app/app.js', 
       '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.spec.js', 
       '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js'] 
      ] 
     } 
     }, 

     // Inject component scss into app.scss 
     sass: { 
     options: { 
      transform: function(filePath) { 
      filePath = filePath.replace('/client/app/', ''); 
      filePath = filePath.replace('/client/components/', ''); 
      return '@import \'' + filePath + '\';'; 
      }, 
      starttag: '// injector', 
      endtag: '// endinjector' 
     }, 
     files: { 
      '<%= yeoman.client %>/app/app.scss': [ 
      '<%= yeoman.client %>/{app,components}/**/*.{scss,sass}', 
      '!<%= yeoman.client %>/app/app.{scss,sass}' 
      ] 
     } 
     }, 

     // Inject component css into index.html 
     css: { 
     options: { 
      transform: function(filePath) { 
      filePath = filePath.replace('/client/', ''); 
      filePath = filePath.replace('/.tmp/', ''); 
      return '<link rel="stylesheet" href="' + filePath + '">'; 
      }, 
      starttag: '<!-- injector:css -->', 
      endtag: '<!-- endinjector -->' 
     }, 
     files: { 
      '<%= yeoman.client %>/index.html': [ 
      '<%= yeoman.client %>/{app,components}/**/*.css' 
      ] 
     } 
     } 
    }, 
+0

私はあなたのDockerfileでAPP_ENVの定義を参照してください、そうしないでください... – user2915097

+0

私はドッキングウィンドウの実行my_image -e APP_ENV = prod' – Bryan

+0

'のようなドッキングウィンドウコンテナを実行したとき、私はありません通過します、あなたはそれを行うことはできません、ビルドはこの環境変数が定義されている必要があります – user2915097

答えて

0

以下のように定義されていました。

Posiable解決策は以下のとおりです。

  1. は警告を修正します。
  2. grunt build =>grunt build --force
関連する問題