Dockerizing npm & bower install using the digitallyseamless/nodejs-bower-grunt docker image

balteo

I am trying to use docker in order to run npm & bower install.

Here is my configuration:

./package.json

{
  "name": "bignibou-client",
  "version": "0.1.0",
  "engines": {
    "node": "0.10.x"
  },
  "devDependencies": {
    "bower": "1.3.12",
    "grunt": "~0.4.5",
    "grunt-contrib-uglify": "~0.6.0",
    "grunt-contrib-concat": "~0.5.0",
    "karma": "~0.12.23",
    "grunt-karma": "~0.9.0",
    "karma-junit-reporter": "~0.2.2",
    "karma-jasmine": "~0.1.5",
    "karma-phantomjs-launcher": "~0.1.4",
    "phantomjs": "~1.9.11",
    "grunt-mkdir": "~0.1.2",
    "grunt-contrib-cssmin": "~0.10.0",
    "grunt-contrib-clean": "~0.6.0",
    "grunt-contrib-copy": "~0.7.0",
    "karma-htmlfile-reporter": "~0.1.2",
    "grunt-filerev": "~2.1.2",
    "grunt-usemin": "~2.6.2",
    "grunt-protractor-runner": "~1.1.4",
    "protractor": "~1.4.0",
    "flow": "~0.2.3",
    "assemble-less": "~0.7.0"
  },
  "scripts": {
    "postinstall": "node_modules/bower/bin/bower install"
  }
}

.bowerrc

{
    "json": "bower.json", "directory": "bignibou-client/src/bower_components"
}

My command:

docker run --privileged=true -it --rm \
   -w /usr/src/app \
   -v $(pwd)/package.json:/usr/src/app/package.json  \
   -v $(pwd)/.bowerrc:/usr/src/app/.bowerrc \
   -v $(pwd)/./bower.json:/usr/src/app/bower.json  \
   -v ./build/npm.tmp/node_modules:/usr/src/app/node_modules  \
   -v ./build/npm.tmp/bignibou-client/src/bower_components:/usr/src/app/bignibou-client/src/bower_components \
   digitallyseamless/nodejs-bower-grunt npm install

I just get the following console output:

npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No license field.

and nothing is generated on the host...

Can someone please provide advice as to how to get it working or an alternative solution?

edit:

Running the following command:

docker run --privileged=true -it --rm \
-w /usr/src/app \
-v $(pwd):/usr/src/app \
digitallyseamless/nodejs-bower-grunt npm install

results in:

npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No license field.
npm WARN cannot run in wd [email protected] node_modules/bower/bin/bower install (wd=/usr/src/app)
Andrey Romashin

-v $(pwd)/package.json:/usr/src/app/package.json

this flag will create a package.json directory but not the file.

Here is how your command should look like:

docker run --privileged=true -it --rm \
-w /usr/src/app \
-v $(pwd):/usr/src/app\
digitallyseamless/nodejs-bower-grunt bash -c "npm install && bower --allow-root install"

And after this script create node_modules and bower_components in current directory on HOST mashine and you can manipulate with result as you wish.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Dockerizing npm & bower install using the digitallyseamless/nodejs-bower-grunt docker image

From Dev

cannot run npm grunt bower using maven

From Dev

docker with bower, grunt

From Dev

docker with bower, grunt

From Dev

Yeoman bower install vs npm install vs grunt

From Dev

grunt bower-install of a shimmed bower dependency

From Dev

Install CKeditor using Bower

From Dev

Install tweenmax using bower

From Dev

Installing Node, NPM (and then Grunt and Bower globally) in Vagrant

From Dev

What are npm, bower, gulp, Yeoman, and grunt good for?

From Dev

Can/should Grunt be used with Bower without Npm?

From Dev

Installing Node, NPM (and then Grunt and Bower globally) in Vagrant

From Dev

npm install bower using -g vs --save-dev

From Dev

grunt-bower-install: exclude certain components

From Dev

Trouble configuring grunt bower-install

From Dev

Configure Grunt-Bower-Install path for a Component

From Dev

Configure Grunt-Bower-Install path for a Component

From Dev

grunt bower-install into the php file

From Dev

Trouble configuring grunt bower-install

From Dev

One command to npm install and bower in npm?

From Dev

Mac alias for npm install && bower install

From Java

Bower install using only https?

From Dev

using grunt-contrib-concat with bower

From Dev

Distribute a compiled JavaScript library using Bower and Grunt

From Dev

Is it possible to update bower dependencies using grunt?

From Java

Using Grunt, Bower, Gulp, NPM with Visual Studio 2015 for a ASP.NET 4.5 Project

From Dev

How can I manage my Javascript libraries in Grunt? Using Bower or NPM?

From Dev

How do install a specific version of Bower with NPM

From Dev

Better to install underscore via NPM or Bower?

Related Related

HotTag

Archive