How to create a Mongo Docker Image with default collections and data?

The problem was that information could not be saved on /db/data, so I’ve created a solution creating my own data directory. # Parent Dockerfile https://github.com/docker-library/mongo/blob/982328582c74dd2f0a9c8c77b84006f291f974c3/3.0/Dockerfile FROM mongo:latest # Modify child mongo to use /data/db2 as dbpath (because /data/db wont persist the build) RUN mkdir -p /data/db2 \ && echo “dbpath = /data/db2” > /etc/mongodb.conf \ … Read more

Cannot find module ‘sass’

To note! node-sass is deprecated as by now! Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass. Instead you can see … Read more

How to access the VM created by docker’s HyperKit?

Update 2019-01-31, thanks to ru10’s update, now there is a better way: screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty Original Answer: After a while, I found following way to get a shell of the VM that was created by HyperKit: Run from terminal: screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty You will see an empty screen, then type enter, you will get a login prompt. … Read more

Assigning vhosts to Docker ports

This answer might be a bit late, but what you need is an automatic reverse proxy. I have used two solutions for that: jwilder/nginx-proxy Traefik With time, my preference is to use Traefik. Mostly because it is well documented and maintained, and comes with more features (load balancing with different strategies and priorities, healthchecks, circuit … Read more

How many CPUs does a docker container use?

As Charles mentions, by default all can be used, or you can limit it per container using the –cpuset-cpus parameter. docker run –cpuset-cpus=”0-2″ myapp:latest That would restrict the container to 3 CPU’s (0, 1, and 2). See the docker run docs for more details. The preferred way to limit CPU usage of containers is with … Read more