danlynn/ember-cli

By danlynn

Updated 1 day ago

ember-cli 6.2.2 + node 22.14.0/23.9.0 + bower 1.8.8 + chrome 134.0.6998.35 + watchman 4.9.0

Image
Languages & Frameworks
Developer Tools
54

500K+

ember-cli logo

This image contains everything you need to have a working development environment for ember-cli. The container's working dir is /myapp so that you can setup a volume mapping your project dir to /myapp in the container. (MIT License)

starspullsautomatedMIT License

ember-cli 6.2.2 + node 22.14.0/23.9.0 + npm 10.9.2/10.9.2 + bower 1.8.8 + yarn 1.22.22/1.22.22 + chrome 134.0.6998.35 + watchman 4.9.0

Supported tags and respective Dockerfile links
Click here to see older versions

This image was originally based on: geoffreyd/ember-cli (hat tip)

Example Ember Octane app using docker-compose

ember octane quick start guide tutorial

This example runs through the Quick Start ember octane guide tutorial. It follows the Quick Start instructions at ember-cli-docker-compose-template for using the danlynn/ember-cli docker image with docker-compose.

Click here to view the video full-size and with playback controls.

How to use

The absolutely easiest way to use this ember-cli docker image is to use docker-compose. I've put together a git repo that contains a stub ember-cli docker-compose template project that makes this a snap! Full details of the optimized docker-compose environment for developing ember-cli project can be found in that repo's README.

Basically, it creates a new project directory with the following files:

ember-project
  docker-compose.yml
  README-template.md
  bash
  ember
  serve

The docker-compose.yml is configured to use this danlynn/ember-cli docker image from dockerhub and looks like this:

version: '2'

services:
  ember:
    image: danlynn/ember-cli:latest
    volumes:
      - .:/myapp
      - .bash_history:/root/.bash_history
      - node_modules:/myapp/node_modules
    tmpfs:
      - /myapp/tmp
    ports:
      - "4200:4200"
      - "7020:7020"
      - "7357:7357"

volumes:
  node_modules:

The bash, ember, and serve commands are shortcuts for performing the most common ember dev tasks.

Quick start instructions:

Copy and run the following 3 lines in your terminal to create a new ember app named 'ember-project' and then host it on http://locahost:4200:

$ proj_dir='ember-project' && curl -Ls https://github.com/danlynn/ember-cli-docker-compose-template/archive/master.zip > "$proj_dir.zip" && unzip -qq -j "$proj_dir.zip" -d "$proj_dir" && rm "$proj_dir.zip" && cd "$proj_dir" && mv README.md README-template.md && ls -l
$ ./ember init
$ ./serve

Replace the "ember-project" at the beginning with the name to use for the new project dir. This first line will create a new directory named "ember-project" populated with the contents of the ember-cli-docker-compose-template repo from github then cd into that directory ready to use. The last 2 lines are common commands that use the 'shortcuts' to run the ember command in the container and then start the ember server.

Slightly more detailed instructions:

More detailed usage instructions can be found in the ember-cli docker-compose template repo README.

Straight docker usage

You can ignore docker-compose completely and simply use straight docker commands to interact with your ember project in the container.

Command Usage for docker run

Basically put docker run --rm -ti -v $(pwd):/myapp danlynn/ember-cli:6.2.2 before any command you run.

Example:

$ docker run --rm -ti -v $(pwd):/myapp danlynn/ember-cli:6.2.2 npm install
$ docker run --rm -ti -v $(pwd):/myapp danlynn/ember-cli:6.2.2 bower --allow-root install bootstrap
$ docker run --rm -ti -v $(pwd):/myapp danlynn/ember-cli:6.2.2 ember generate model user
$ docker run --rm -ti -v $(pwd):/myapp -p 4200:4200 -p 7020:7020 -p 7357:7357 danlynn/ember-cli:6.2.2

Note that the --rm prevents a bunch of stopped containers from accumulating from these one-off commands. They take up space and since pretty much any change made by these commands will only affect what is in your project dir (/myapp in the container), there is no need to keep them around.

Launching bash shell then running commands directly

You could simply launch into a bash shell and execute the commands in the normal fashion:

$ mkdir new_ember_app
$ cd new_ember_app
$ docker run --rm -it -v $(pwd):/myapp -p 4200:4200 -p 7020:7020 -p 7357:7357 danlynn/ember-cli:6.2.2 bash

root@9ad4805d2b50:/myapp# ember init
root@9ad4805d2b50:/myapp# ember init --yarn
root@9ad4805d2b50:/myapp# npm install
root@9ad4805d2b50:/myapp# bower --allow-root install
root@9ad4805d2b50:/myapp# ember server
root@9ad4805d2b50:/myapp# ember test
root@9ad4805d2b50:/myapp# ember test --server

Note that bash had to be launched with -p 4200:4200 -p 7020:7020 in order to be able to access the ember server on port 4200 and enable Livereload on port 7020. The -p 7357:7357 is needed if you intend to run ember test --server.

Also note that the npm install is done automagicall

Docker Pull Command

docker pull danlynn/ember-cli