The notable files for building the Docker image are:
Dockerfile
assets
- files copied to the imagebuild
- the build script
The majority of the install logic resides in the assets/build script. The intent is to mitigate issues that arise from stacking too many AUFS layers.
This project ships with a Vagrantfile
to simplify the process of using and/or building the image.
git clone https://github.com/hopsoft/docker-nodejs.git
cd docker-nodejs
Note: Ports 3000, 4000, & 5000 are mapped between the host & the virtual machine.
vagrant up
vagrant ssh
sudo docker build -t hopsoft/nodejs /vagrant
sudo docker run -i -t -p 3000:3000 hopsoft/nodejs bash
npm install -g echo-server
echo-server 3000
Test from the host (or the virtual machine).
curl http://localhost:3000/foo/bar