A docker container to develop with polymer-cli
The polymer-cli version includes several improvements see the lastest polymer-cli documentation
The entrypoint of this container is polymer (polymer-cli command line) and some bower commands. By default the image run the "polymer serve"
available commands are :
- Special command :
- docs : Writes analysis metadata in JSON format to standard out without inherited methods from Polymer.element
- Polymer commands :
- init : initialize a developpment ( run polymer init )
- build : build the application
- lint : lints the project
- serve : Runs the polyserve development server
- analyze : Writes analysis metadata in JSON format to standard out
- lint : Identifies potential errors in your code.
- Bower commands :
- install [package]: install dependencies declared in bower.json or the package given on the command line
- uninstall package : uninstall a package
- update package : update an installed package
- search package : search for a package in the bower repository
- list : list all installed packages
- prune : uninstalls local extraneous packages
- info package : displays overall information of a package or of a particular version.
- cache : manage bower cache
A command line helper is also provided, to avoid typing long docker commands. To get it :
curl https://raw.githubusercontent.com/zedesk/zdkpolymer/master/zdkpolymer |sudo tee /usr/local/bin/zdkpolymer > /dev/null
sudo chmod a+x /usr/local/bin/zdkpolymer
the zdkpolymer
command helper should be run from the project directory. The container will be named as the directory.
zdkpolymer -h
: the helper helpzdkpolymer -v
: list available versionszdkpolymer [OPTIONS] [COMMAND]
Options :
- -H : mount your home directory, useful to share some git credential and config into the container
- -D : run the container in background, useful when serving your work, The available URLs will be displayed.
- -V [arg] : allow to select the zdkpolymer version, for example '0.17.0'
Command :
Any polymer-cli or bower commands, to obtain the list of the
available commands : zdkpolymer help
Create your dev directory
mkdir my-component && cd $_
zdkpolymer init
to start serving your dev
zdkpolymer -D
to get the port of your app on the host machine
zdkpolymer port
Get your project
git clone github.com/my-project
cd my-project
install dependencies
zdkpolymer install
serve it
zdkpolymer -D
to build a polymer application :
zdkpolymer build
then to serve the application
# stop the container if exists
zdkpolymer stop
zdkpolymer -D build/unbundled