Skip to content

Instantly share code, notes, and snippets.

@SimplyAhmazing
Last active December 15, 2016 17:58
Show Gist options
  • Save SimplyAhmazing/cdf7a0798cfa148110b67dcbbba9acf3 to your computer and use it in GitHub Desktop.
Save SimplyAhmazing/cdf7a0798cfa148110b67dcbbba9acf3 to your computer and use it in GitHub Desktop.
Docker ProTips
  • First things first, install VirtualBox
  • Use docker-machine to provision "default" docker VM (no longer use boot2docke, ever!)

Enable port forwarding on your VM,

for i in {10000..10999}; do
    VBoxManage modifyvm "default" --natpf1 "tcp-port$i,tcp,,$i,,$i";
    VBoxManage modifyvm "default" --natpf1 "udp-port$i,udp,,$i,,$i";
done

To start elasticsearch,

Increase vm max heap count,

docker-machine ssh [machine]
sudo -i
sysctl -w vm.max_map_count=262144

Run container,

docker run \
    --name=es2 -d \
    -p 9200:9200 -p 9300:9300 \
    -v /Users/ahmed/Projects/open-trons/store-protocols/releases:/releases \
    elasticsearch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment