Skip to content

Instantly share code, notes, and snippets.

@koko1000ban
Created August 23, 2013 02:14
Show Gist options
  • Save koko1000ban/6314886 to your computer and use it in GitHub Desktop.
Save koko1000ban/6314886 to your computer and use it in GitHub Desktop.
docker lunch on private
#!/bin/bash
CONTAINERS=(app mysql redis memcached)
for container in ${CONTAINERS[@]}; do
container_id=$(sudo docker run -d -dns 172.17.42.1 tabito/centos_base)
echo "$(sudo docker inspect ${container_id} | grep IPAddress | cut -d '"' -f 4) ${container}.local" | sudo tee -a /etc/hosts
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment