Building container images done right with Habitus 1.0!

What’s Habitus?

Habitus feature set

  • Use build.yml to build the image
  • Supports multi-tenancy of builds by using UID parameters
  • Allows to run arbitrary commands inside of the build container
  • Allows dovetailing (sequencing) of the images from different steps
  • After the build, Habitus will run Cleanup command. This will result in ‘squashing’ the image, therefore removing any traces of unwanted layers
  • Allows you to define and manage secrets configuration (file and environment variables based) for your build
  • Allows you specify any artifacts or folder of artifacts — they’ll be copied from the built image onto the working directory, so they’ll be available for next steps.
  • Support for non-TLS connections to Docker daemons.

New 1.0 features

Easy installation

Run arbitrary commands after a build step.

build:    version: 2016-03-14    steps:      step1:         name: step1         dockerfile: Dockerfile         # run on the host after this build step         after_build_command: some_host_command         # will run in the running container after it's built        command: some_container_command

Don’t use cache in a build step

build:    version: 2016-03-14    steps:      step1:         name: step1         dockerfile: Dockerfile         no_cache: true

Support to use environment variables as secrets.

build:    version: 2016-03-14    steps:      builder:         name: builder         dockerfile: Dockerfile         no_cache: true         secrets: my_env_secret:         type: env         value: VERY_SECRET_STUFF
... RUN wget -qO- http://$host:$port/v1/secrets/env/my_env_secret | less ...

Using Habitus with Cloud 66

services:    your-service:      git_url: http://github.com/your-nick/your-service.git     git_branch: master      env_vars:         HABITUS_VERY_SECRET_STUFF: launch_codes     use_habitus: true     use_habitus_step: builder     build_root: microservices/a-small-service
build:    version: 2016-03-14    steps:       builder:       name: builder       dockerfile: Dockerfile       no_cache: true       secrets:          my_env_secret:              type: env              value: VERY_SECRET_STUFF
FROM ubuntu:16.04 
# install packages
RUN apt-get update RUN apt-get install wget -y RUN apt-get install less -y # values populated by Cloud 66 ARG habitus_host ARG habitus_port ARG habitus_password ARG habitus_user # call secret service RUN wget --http-user=$habitus_user --http-password=$habitus_password -qO- http://$habitus_host:$habitus_port/v1/secrets/env/my_env_secret | less

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store