Skip to content

Instantly share code, notes, and snippets.

@blasterpal
Last active April 8, 2017 01:15
Show Gist options
  • Save blasterpal/a942961b5cd7772f889a944161f365b6 to your computer and use it in GitHub Desktop.
Save blasterpal/a942961b5cd7772f889a944161f365b6 to your computer and use it in GitHub Desktop.
Docker for Mac Setup/Notes

Notes

making notes as I transition from DockerMachine/VBox to Docker for Mac https://blog.bennycornelissen.nl/docker-for-mac-neat-fast-and-flawed/

Fundamental Dev Env Questions

  1. Should DBs live inside D4M and use bind mount for Data (this makes setup for others MUCH easier) -OR- Use Host DBs
  2. Where should code live and how to inject source dir into Compose. Could use a single env var that is customizable. i.e. export D4M_DEV_SOURCE="/Users/hbeaver/code"

Kernel

kernel running on D4M is Moby, not the distro you have in your image.

root@ddb00cb996cc:/proc# more version
Linux version 4.9.13-moby (root@11fbdc1f630f) (gcc version 6.2.1 20160822 (Alpine 6.2.1) ) #1 SMP Sat Mar 25 02:48:44 UTC 2017

Connecting to Host Net

https://docs.docker.com/docker-for-mac/faqs/#how-do-i-connect-from-a-container-to-a-service-on-the-host

sudo ifconfig lo0 alias 172.16.1.1

Shelling into Docker for Mac

Granting access to PG from D4M

Add the following to your pg_hba.conf file.

 host    all             all             172.16.1.1/24        trust

Restart PG brew services restart postgresql

Alternately - running PG in Docker

Using Docker for Mac PG can easily write to OSX disk. Previously, this was a major pain in the ass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment