Closed cmelion closed 8 years ago
I finally have access to Docker Beta for Mac! With any luck I'll have an image for ng2-webpack built this weekend.
For those of you that read my post on Docker, this is big news. It lets us spin up a container and still take advantage of hot-loading from the comfort of our preferred IDE, no more restarting the container or expensive r-sync operations.
The Dockerfile has been published to DockerHub: https://hub.docker.com/r/cmelion/generator-ng2-webpack/
You can pull the complete image and be up and running very quickly via Kitematic (I'm using the beta with Docker for Mac Beta).
The container spins up and the site works as expected, but I'm struggling to figure out how volumes work: https://forums.docker.com/t/mounting-a-volume-and-accessing-from-kitematic-beta/10953
Any help I can get with this issue will be greatly appreciated.
Looking into https://github.com/nlf/dlite as an alternative to Docker Beta.
The key to resolving the VOLUME mapping appears to be the entrypoint:
For example: COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]
Digging into https://github.com/docker-library/ghost/blob/dce058cc4528fee2efa3cdd0d4d12feed8d91a5d/docker-entrypoint.sh
Determined that, while it's a nice to have to "seed" the host directory from the container, it's not really necessary.
Still need to work out the complete workflow but as long as the src directory exists performing docker run -v with identical port mappings works flawlessly. If the ports are mis-matched then hot-loading won't work.
docker run -t -i -p 8080:8080 -v /Users/user/Documents/Kitematic/generator-ng2-webpack/src:/home/yeoman/client/src cmelion/ng2webpack:v12
see https://github.com/cmelion/generator-ng2-webpack/wiki/Why-Docker%3F