Yeoman wrapped in a Dockerfile to use it in different projects for my environment.
Make sure you have installed all of the following prerequisites on your development machine:
This should start up an environment for scaffolding with Yeoman.
$ docker build -t uwegerdes/yeoman .
Start container in your project directory (with own generators in subdirectory yo_src) and another directory with generators:
$ docker run -it \
-v /home/user/some/directory/with/yo_src:/home/node/yo_src \
-v $(pwd):/home/node/app \
--name project-yeoman \
uwegerdes/yeoman bash
Generators from /home/node/yo_src and /home/node/app/yo_src are linked to /home/node/node_modules and should be available for yo.
Install a generator (--save in projects package.json) with:
$ npmisd generator-generator
This command uses a small script that copies
The package.json in your working directory (linked to /home/node/app) is used - so you can rebuild a full blown yeoman generator collection.
If you will want to restart and attach to the container (just hit RETURN to get a prompt):
$ docker start -ai yeoman
You can also docker commit the container to have the generators ready for a new container.
Generate with yeoman with the wizard or use a special subgenerator:
$ yo generator
$ yo generator:subgenerator <name>
The package generator-generator is installed for your convenience.
If you have templates for Yeoman you can link that directory as a volume and the yo command will find it.
Please go to your project base directory and run the container with:
$ docker run -it --rm \
-v ~/projekts/yeoman/yo_src:/home/node/yo_src \
-v $(pwd):/home/node/app \
--name yeoman \
uwegerdes/yeoman
To execute tests for your developing generator use:
$ docker run -it --rm \
-v ~/projekts/yeoman/yo_src:/home/node/yo_src \
-v $(pwd):/home/node/app \
--name yeoman \
uwegerdes/yeoman bash
node@docker$ cd yo_src/generator-mygenerator
node@docker$ npm test
Start another bash in a running container:
$ docker exec -it yeoman bash
$ cd /home/node/yo_src/generator-tle
$ npm test
Content type
Image
Digest
Size
287.9 MB
Last updated
over 6 years ago
docker pull uwegerdes/yeoman