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)
ember-cli 6.0.1 + node 22.11.0/23.1.0 + npm 10.9.0/10.9.0 + bower 1.8.8 + yarn 1.22.22/1.22.22 + chrome 131.0.6778.69 + watchman 4.9.0
6.0.1
,6.0.1-node_22.11
,latest
(6.0.1/Dockerfile)6.0.1-node_23.1
(6.0.1-node_23.1/Dockerfile)5.12.0
,5.12.0-node_20.18
(5.12.0/Dockerfile)5.12.0-node_22.9
(5.12.0-node_22.9/Dockerfile)5.11.0
,5.11.0-node_20.17
(5.11.0/Dockerfile)5.11.0-node_22.7
(5.11.0-node_22.7/Dockerfile)5.10.0
,5.10.0-node_20.15
(5.10.0/Dockerfile)5.10.0-node_22.4
(5.10.0-node_22.4/Dockerfile)5.9.0
,5.9.0-node_20.14
(5.9.0/Dockerfile)5.9.0-node_22.2
(5.9.0-node_22.2/Dockerfile)
Click here to see older versions
5.8.1
,5.8.1-node_20.12
(5.8.1/Dockerfile)5.8.1-node_22.1
(5.8.1-node_22.1/Dockerfile)5.8.0
,5.8.0-node_20.12
(5.8.0/Dockerfile)5.8.0-node_21.7
(5.8.0-node_21.7/Dockerfile)5.7.0
,5.7.0-node_20.11
(5.7.0/Dockerfile)5.7.0-node_21.7
(5.7.0-node_21.7/Dockerfile)5.6.0
,5.6.0-node_20.11
(5.6.0/Dockerfile)5.6.0-node_21.6
(5.6.0-node_21.6/Dockerfile)5.5.0
,5.5.0-node_20.10
(5.5.0/Dockerfile)5.5.0-node_21.4
(5.5.0-node_21.4/Dockerfile)5.4.1
,5.4.1-node_20.10
(5.4.1/Dockerfile)5.4.1-node_21.2
(5.4.1-node_21.2/Dockerfile)5.3.0
,5.3.0-node_18.18
(5.3.0/Dockerfile)5.3.0-node_20.7
(5.3.0-node_20.5/Dockerfile)5.2.1
,5.2.1-node_18.17
(5.2.1/Dockerfile)5.2.1-node_20.5
(5.2.1-node_20.5/Dockerfile)5.1.0
,5.1.0-node_18.17
(5.1.0/Dockerfile)5.1.0-node_20.5
(5.1.0-node_20.5/Dockerfile)5.0.0
,5.0.0-node_18.16
(5.0.0/Dockerfile)5.0.0-node_20.3
(5.0.0-node_20.3/Dockerfile)4.12.1
,4.12.1-node_18.16
(4.12.1/Dockerfile)4.12.1-node_20.2
(4.12.1-node_20.2/Dockerfile)4.11.0
,4.11.0-node_18.14
(4.11.0/Dockerfile)4.11.0-node_19.7
(4.11.0-node_19.7/Dockerfile)4.10.0
,4.10.0-node_18.13
(4.10.0/Dockerfile)4.10.0-node_19.4
(4.10.0-node_19.4/Dockerfile)4.9.2
,4.9.2-node_18.12
(4.9.2/Dockerfile)4.9.2-node_19.3
(4.9.2-node_19.3/Dockerfile)4.8.0
,4.8.0-node_18.12
(4.8.0/Dockerfile)4.8.0-node_19.1
(4.8.0-node_19.1/Dockerfile)4.7.0
,4.7.0-node_16.17
(4.7.0/Dockerfile)4.7.0-node_18.9
(4.7.0-node_18.9/Dockerfile)4.6.0
,4.6.0-node_16.16
(4.6.0/Dockerfile)4.6.0-node_18.7
(4.6.0-node_18.7/Dockerfile)4.5.0
,4.5.0-node_16.16
(4.5.0/Dockerfile)4.5.0-node_18.5
(4.5.0-node_18.5/Dockerfile)4.4.0
,4.4.0-node_16.15
(4.4.0/Dockerfile)4.4.0-node_18.2
(4.4.0-node_18.2/Dockerfile)4.3.0
,4.3.0-node_16.14
(4.3.0/Dockerfile)4.3.0-node_17.8
(4.3.0-node_17.8/Dockerfile)4.2.0
,4.2.0-node_16.14
(4.2.0/Dockerfile)4.2.0-node_17.6
(4.2.0-node_17.6/Dockerfile)4.1.1
,4.1.1-node_16.13
(4.1.1/Dockerfile)4.1.1-node_17.3
(4.1.1-node_17.3/Dockerfile)4.1.0
,4.1.0-node_16.13
(4.1.0/Dockerfile)4.1.0-node_17.3
(4.1.0-node_17.3/Dockerfile)4.0.1
,4.0.1-node_16.13
(4.0.1/Dockerfile)4.0.1-node_17.3
(4.0.1-node_17.3/Dockerfile)3.28.5
,3.28.5-node_16.13
(3.28.5/Dockerfile)3.28.2
,3.28.2-node_14.18
(3.28.2/Dockerfile)3.28.2-node_16.11
(3.28.2-node_16.11/Dockerfile)3.28.0
,3.28.0-node_14.17
(3.28.0/Dockerfile)3.28.0-node_16.8
(3.28.0-node_16.8/Dockerfile)3.27.0
,3.27.0-node_14.17
(3.27.0/Dockerfile)3.27.0-node_16.3
(3.27.0-node_16.3/Dockerfile)3.26.1
,3.26.1-node_14.16
(3.26.1/Dockerfile)3.26.1-node_15.14
(3.26.1-node_15.14/Dockerfile)3.26.0
,3.26.0-node_14.16
(3.26.0/Dockerfile)3.26.0-node_15.14
(3.26.0-node_15.14/Dockerfile)3.25.3
,3.25.3-node_14.16
(3.25.3/Dockerfile)3.25.3-node_15.12
(3.25.3-node_15.12/Dockerfile)3.25.2
,3.25.2-node_14.16
(3.25.2/Dockerfile)3.25.2-node_15.11
(3.25.2-node_15.11/Dockerfile)3.25.1
,3.25.1-node_14.16
(3.25.1/Dockerfile)3.25.1-node_15.11
(3.25.1-node_15.11/Dockerfile)3.25.0
,3.25.0-node_14.15
(3.25.0/Dockerfile)3.25.0-node_15.8
(3.25.0-node_15.8/Dockerfile)3.24.0
,3.24.0-node_14.15
(3.24.0/Dockerfile)3.24.0-node_15.5
(3.24.0-node_15.5/Dockerfile)3.23.0
,3.23.0-node_14.15
(3.23.0/Dockerfile)3.23.0-node_15.4
(3.23.0-node_15.4/Dockerfile)3.22.0
,3.22.0-node_12.19
(3.22.0/Dockerfile)3.22.0-node_14.14
(3.22.0-node_14.14/Dockerfile)3.21.2
,3.21.2-node_12.18
(3.21.2/Dockerfile)3.21.2-node_14.11
(3.21.2-node_14.11/Dockerfile)3.21.0
,3.21.0-node_12.18
(3.21.0/Dockerfile)3.21.0-node_14.9
(3.21.0-node_14.9/Dockerfile)3.20.0
,3.20.0-node_12.18
(3.20.0/Dockerfile)3.20.0-node_14.6
(3.20.0-node_14.6/Dockerfile)3.18.0
,3.18.0-node_12.16
(3.18.0/Dockerfile)3.18.0-node_14.1
(3.18.0-node_14.1/Dockerfile)3.17.0
,3.17.0-node_12.16
(3.17.0/Dockerfile)3.17.0-node_13.10
(3.17.0-node_13.10/Dockerfile)3.16.0
,3.16.0-node_12.16
(3.16.0/Dockerfile)3.16.0-node_13.8
(3.16.0-node_13.8/Dockerfile)3.15.2
,3.15.2-node_12.14
(3.15.2/Dockerfile)3.15.2-node_13.5
(3.15.2-node_13.5/Dockerfile)3.14.0
,3.14.0-node_12.13
(3.14.0/Dockerfile)3.14.0-node_13.1
(3.14.0-node_13.1/Dockerfile)3.13.0
,3.13.0-node_10.16
(3.13.0/Dockerfile)3.13.0-node_12.10
(3.13.0-node_12.10/Dockerfile)3.12.0
,3.12.0-node_10.16
(3.12.0/Dockerfile)3.12.0-node_12.8
(3.12.0-node_12.8/Dockerfile)3.11.0
,3.11.0-node_10.16
(3.11.0/Dockerfile)3.11.0-node_12.6
(3.11.0-node_12.6/Dockerfile)3.10.1
,3.10.1-node_10.15
(3.10.1/Dockerfile)3.10.1-node_12.3
(3.10.1-node_12.3/Dockerfile)3.9.0
,3.9.0-node_10.15
(3.9.0/Dockerfile)3.9.0-node_11.13
(3.9.0-node_11.13/Dockerfile)3.8.2
,3.8.2-node_10.15
(3.8.2/Dockerfile)3.8.2-node_11.13
(3.8.2-node_11.13/Dockerfile)3.7.1
,3.7.1-node_10.15
(3.7.1/Dockerfile)3.7.1-node_11.6
(3.7.1-node_11.6/Dockerfile)3.6.1
,3.6.1-node_10.15
(3.6.1/Dockerfile)3.6.1-node_11.6
(3.6.1-node_11.6/Dockerfile)3.5.1
,3.5.1-node_10.13
(3.5.1/Dockerfile)3.5.1-node_11.1
(3.5.1-node_11.1/Dockerfile)3.4.3
,3.4.3-node_8.12
(3.4.3/Dockerfile)3.4.3-node_10.11
(3.4.3-node_10.11/Dockerfile)3.3.0
,3.3.0-node_8.11
(3.3.0/Dockerfile)3.3.0-node_10.7
(3.3.0-node_10.7/Dockerfile)3.2.0
,3.2.0-node_8.11
(3.2.0/Dockerfile)3.2.0-node_10.6
(3.2.0-node_10.6/Dockerfile)3.1.4
,3.1.4-node_8.11
(3.1.4/Dockerfile)3.1.4-node_10.1
(3.1.4-node_10.1/Dockerfile)3.0.0
,3.0.0-node_8.9
(3.0.0/Dockerfile)3.0.0-node_9.5
(3.0.0-node_9.5/Dockerfile)2.18.2
,2.18.2-node_8.9
(2.18.2/Dockerfile)2.18.2-node_9.5
(2.18.2-node_9.5/Dockerfile)2.17.1
,2.17.1-node_8.9
(2.17.1/Dockerfile)2.17.1-node_9.3
(2.17.1-node_9.3/Dockerfile)2.16.2
,2.16.2-node_6.11
(2.16.2/Dockerfile)2.16.2-node_8.4
(2.16.2-node_8.4/Dockerfile)2.15.1
,2.15.1-node_6.11
(2.15.1/Dockerfile)2.15.1-node_8.4
(2.15.1-node_8.4/Dockerfile)2.14.2
(2.14.2/Dockerfile)2.14.2-node_6.11
(2.14.2-node_6.11/Dockerfile)2.13.3
(2.13.3/Dockerfile)2.13.3-node_6.11
(2.13.3-node_6.11/Dockerfile)2.12.2
(2.12.2/Dockerfile)2.12.2-node_6.10
(2.12.2-node_6.10/Dockerfile)2.11.1
(2.11.1/Dockerfile)2.11.1-node_6.10
(2.11.1-node_6.10/Dockerfile)2.10.1
(2.10.1/Dockerfile)2.10.1-node_6.9
(2.10.1-node_6.9/Dockerfile)2.9.1
(2.9.1/Dockerfile)2.9.1-node_6.9
(2.9.1-node_6.9/Dockerfile)2.8.0
(2.8.0/Dockerfile)2.7.0
(2.7.0/Dockerfile)2.6.3
(2.6.3/Dockerfile)2.5.1
(2.5.1/Dockerfile)2.4.3
(2.4.3/Dockerfile)2.3.0
(2.3.0/Dockerfile)1.13.15
(1.13.15/Dockerfile)
This image was originally based on: geoffreyd/ember-cli (hat tip)
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.
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.
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.
More detailed usage instructions can be found in the ember-cli docker-compose template repo README.
You can ignore docker-compose completely and simply use straight docker commands to interact with your ember project in the container.
Basically put docker run --rm -ti -v $(pwd):/myapp danlynn/ember-cli:6.0.1
before any command you run.
Example:
$ docker run --rm -ti -v $(pwd):/myapp danlynn/ember-cli:6.0.1 npm install
$ docker run --rm -ti -v $(pwd):/myapp danlynn/ember-cli:6.0.1 bower --allow-root install bootstrap
$ docker run --rm -ti -v $(pwd):/myapp danlynn/ember-cli:6.0.1 ember generate model user
$ docker run --rm -ti -v $(pwd):/myapp -p 4200:4200 -p 7020:7020 -p 7357:7357 danlynn/ember-cli:6.0.1
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.
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.0.1 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 automagically by the ember init
command on newer versions of ember. Also, bower --allow-root install
is not used as much anymore. There are no bower packages or dependencies in the default project created by ember init
. Using the --yarn
option on ember init --yarn
will use yarn instead of npm to install dependencies.
Also note that both npm and bower are pretty much being replaced by yarn. Newer versions of ember-cli have built-in support for yarn on many commands. Yarn works smoothly in place of npm. Yarn can also replace your use of bower. However, even though yarn used to support bower file formats directly, it no longer does. You should instead use yarn's support for installing front-end web components.
-
While the ember-cli server is running in the docker container, it will detect changes to the ember webapp files. These changes will automagically be detected and the associated files will be recompiled and the browser will auto-reload showing the changes.
Note, however, that if you get an error something like:
ember_1 | Error: A non-recoverable condition has triggered. Watchman needs your help! ember_1 | The triggering condition was at timestamp=1450119416: inotify-add-watch(/myapp/node_modules/ember-cli/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexify/node_modules/readable-stream/doc) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl ember_1 | All requests will continue to fail with this message until you resolve ember_1 | the underlying problem. You will find more information on fixing this at ember_1 | https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch
This means that watchman is running out of resources trying to track all the files in a large ember app. To increase the
fs.inotify.max_user_watches
count to something that is more appropriate for an ember app, stop your docker-compose server by hitting ctrl-c (ordocker-compose stop server
if necessary) then execute the following command:$ docker run --rm --privileged danlynn/ember-cli:3.7.1 sysctl -w fs.inotify.max_user_watches=524288
Note that this will affect all containers that run on the current docker-machine from this point forward because
fs.inotify.max_user_watches
is a system-wide setting. This shouldn't be a big deal however, so go ahead and give it a try. Then start the docker-compose service again with$ docker-compose up
-
Some IDEs (Intelli-J) have features that can wreak havoc with the build system. If the IDE quickly writes temp files into the project tree then deletes them before or while the Ember build system is processing the changes then the build system can crash.
When this happens, you will see something like the following in the build console:
ember_1 | file deleted templates/application.hbs___jb_old___ ember_1 | file deleted templates/application.hbs___jb_tmp___ ember_1 | file changed templates/application.hbs ember_1 | Cannot find module 'broccoli/package' ember_1 | ember_1 | ember_1 | Stack Trace and Error Report: /tmp/error.dump.644b7ae2dd9e56d5eef7b92b898c1235.log ember_1 | TypeError: Cannot read property 'broccoliNode' of undefined
The fix is to change your IDE's settings in order to avoid this behavior. For Intelli-J IDEs, it is the "safe write" feature that causes additional transient files to be generated and quickly deleted upon every save. This feature can be turned OFF without affecting IDE behavior by going to Settings > Appearance & Behavior > System Settings and then unchecking the 'Use "safe write" (save changes to a temporary file first)' checkbox. After turning this feature OFF, you can make changes to your files and the ember build system will pick them up and perform builds without further issue.