Skip to content

Instantly share code, notes, and snippets.

@ripla
Last active August 29, 2015 14:14
Show Gist options
  • Save ripla/f8b6708e0bae4ad49f60 to your computer and use it in GitHub Desktop.
Save ripla/f8b6708e0bae4ad49f60 to your computer and use it in GitHub Desktop.
Install Homebrew, Docker and start a PostgreSQL container from scratch
#Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#Install Cask
brew install caskroom/cask/brew-cask
#Install Virtualbox binary
brew cask install virtualbox
#Install Docker and OSX Docker helper
brew install docker
brew install boot2docker
#Start up Docker helper
boot2docker init
boot2docker up
#Export the environment variables
export DOCKER_HOST=tcp://<fill>
export DOCKER_CERT_PATH=<fill>
export DOCKER_TLS_VERIFY=1
#Pull the newest PostgreSQL image
docker pull postgres:9.4
#Start up the container
docker run --name test-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecret -d postgres
#Connect to jdbc:postgresql://<ip>:5432/postgres
#Where ip is provided by
boot2docker ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment