#Habitat Quickstart Guide
Everything you need to run your first Habitat artifact (.hart package) inside of a docker-machine instance.
Based off my experiences trying to follow: https://www.habitat.sh/tutorials/getting-started-overview/
- Docker 1.9+
- Docker-Machine 0.5+
brew update
brew install docker-machine
####Habitat binaries: For reference, we'll install these in the following steps
You'll need this later when you're ready to upload your finished Habitat artifacts.
- Go to https://app.habitat.sh/#/origins
- Sign up, follow steps to setup Github auth
- NOTE: Your email must be public in github settings
- Add an origin for yourself
# You could create a non-default instance here too,
# but the remaining steps will assume you used 'default'
# Skip if you don't already have a default docker-machine instance
docker-machine rm default
docker-machine create --driver virtualbox --virtualbox-cpu-count "2" --virtualbox-disk-size "40960" --virtualbox-memory "4096" default
eval $(docker-machine env default)
curl -s -J -L -o /tmp/hab-darwin-0.8.0.tar.gz "https://bintray.com/habitat/stable/download_file?file_path=darwin%2Fx86_64%2Fhab-0.8.0-20160708205701-x86_64-darwin.zip"
unzip -u /tmp/hab-darwin-0.8.0.tar.gz -d /tmp
cp /tmp/hab-0.8.0-20160708205701-x86_64-darwin/hab /usr/local/bin/
# Answer 'Yes' to all the token/depot setup questions
# Use the same origin you setup in the Habitat UI
# Setup a github auth token when prompted and paste it in, needs 'user:email' rights only.
hab setup
hab origin key upload <your origin name>
Add this to your bashrc/profile and run it:
function hab-init {
eval $(docker-machine env default)
# https://github.com/habitat-sh/habitat/issues/755
docker-machine ssh default "sudo /usr/sbin/adduser -D hab"
docker-machine ssh default "mkdir -p ~docker/.local/bin"
curl -s -J -L -o /tmp/hab-0.8.0.tar.gz "https://bintray.com/habitat/stable/download_file?file_path=linux%2Fx86_64%2Fhab-0.8.0-20160708161531-x86_64-linux.tar.gz"
tar --strip 1 -C /tmp -xzf /tmp/hab-0.8.0.tar.gz
docker-machine scp /tmp/hab default:~docker/.local/bin/
docker-machine scp -r ~/.hab default:
}
See https://app.habitat.sh/#/pkgs/core for more pre-built Hab artifacts to run.
docker-machine ssh
sudo -s
hab start core/redis
docker-machine restart
hab-init