Sign inSign up

centular/docker-polymer-cli

By centular

Updated almost 9 years ago

This is image contains a set of necessary tools for Polymer CLI and Polymer Starter Kit Development

Image
0

1.6K

centular/docker-polymer-cli repository overview

centular/docker-polymer-cli

Forked from jefferyb/docker-polymer-cli

This is image contains a set of necessary tools for Polymer CLI and Polymer Starter Kit Development so you can get up and running developing with Polymer without installing all the tools on your own computer.

This image is built weekly, with all the latest tools...

What's new:

Supported tags

Build an app with App Toolbox

Using the Polymer Project Documentation:

Initialize & serve your project from a template
===============================================

1. Create a new project folder to start from

	$ mkdir my-app
	$ cd my-app

2. Initialize your project with an app template

	$ docker run --rm -v $(pwd):/home/polymer/app centular/docker-polymer-cli polymer init starter-kit

3. Serve your project

	$ docker run --name polymer-project -d -p 8080:8080 -v $(pwd):/home/polymer/app centular/docker-polymer-cli polymer serve -H 0.0.0.0

	and just point your browser to port 8080

4. When you're done serving your project

	$ docker rm -f polymer-project

How to use this image?

Go to your Polymer project folder, then execute:

docker run --name polymer-project -d -p 8080:8080 -v $(pwd):/home/polymer/app centular/docker-polymer-cli polymer serve -H 0.0.0.0

Once it's up and running, just point your browser to port 8080...

Quick Tip

Since the docker run command is long, and if you're going to be using it often, I would suggest creating/adding an alias for it in your .bash_profile or .bashrc, like:

alias polymer="docker run --name polymer-project --rm -it -p 8080:8080 -v $(pwd):/home/polymer/app centular/docker-polymer-cli polymer "

and then you can just use polymer along with the Polymer CLI commands, like:

polymer init starter-kit

to initialize a Polymer project from the starter-kit or one of other several templates, or

polymer serve -H 0.0.0.0

to run a development server that you can reach at port 8080

Polymer-CLI Commands

Polymer-CLI includes a number of tools for working with Polymer and Web Components:

  • init - Initializes a Polymer project from one of several templates
  • build - Builds an application-style project
  • lint - Lints the project
  • serve - Runs a development server
  • test - Runs tests with web-component-tester

Tools included in this image:

This image includes:

* LTS version (4.x) of Node.js
* git
* gulp
* Bower
* Polymer CLI
* generator-polymer-init-custom-build

And you can make alias for them too to work with your project with something like:

alias git-docker="docker run --rm -v $(pwd):/home/polymer/app centular/docker-polymer-cli git "
alias npm-docker="docker run --rm -v $(pwd):/home/polymer/app centular/docker-polymer-cli npm "
alias node-docker="docker run --rm -v $(pwd):/home/polymer/app centular/docker-polymer-cli node "
alias bower-docker="docker run --rm -v $(pwd):/home/polymer/app centular/docker-polymer-cli bower "
alias gulp-docker="docker run --rm -v $(pwd):/home/polymer/app -p 5000:5000 centular/docker-polymer-cli gulp "

and then, for example, you can use:

git-docker clone https://github.com/PolymerElements/polymer-starter-kit.git
npm-docker install or npm-docker update
bower-docker install or bower-docker update
gulp-docker serve

and just point your browser to port 5000 to get started with Polymer Starter Kit.

Container Shell Access

The docker exec command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your Polymer project container:

docker exec -it polymer-project bash

If you want to connect as root (for example to install a package), then execute:

docker exec -it -u root polymer-project bash

Tag summary

Content type

Image

Digest

Size

367.5 MB

Last updated

almost 9 years ago

docker pull centular/docker-polymer-cli