A Dockerfile for my own setup of NodeJS on an Ubuntu base.
NodeJS is a little bit of a pain on Windows, and I wanted a dev environment that was consistent across multiple machines.
$ docker pull lewisgj/nodede
or inside a fresh copy of this repo:
$ docker build . -t "lewisgj/NodeDE"
Then run:
$ docker run -v /some/local/dir:/home/developer/projects -it lewisgj/NodeDE
to mount /some/local/dir inside the default user's home directory with everything set up.
Getting this to work on Windows as I'd like is a pain as Powershell and CMD always use Windows line endings, but Bash running inside the container won't accept them.
As a workaround, it's possible to use the Windows Subsystem for Linux on Windows 10.
- Install Docker For Windows (not Docker Toolbox)
- Install Windows Subsystem For Linux (*a.k.a BASH for Windows 10)
- Restart, Run bash, then
apt-get install docker.io
- Modify ~/.bashrc, adding:
export DOCKER_HOST=127.0.0.1:2375
source ~/.bashrc
- Then just use your Bash session to do anything docker-related.
I assume this works because the Windows Subsystem sends different line-endings to Bash.