Coder Social home page Coder Social logo

dockerhelper's Introduction

Dockerhelper

Helper classes and rake tasks to build Docker images, push them to DockerHub, and deploy updates to Kubernetes. Assumes a rather specific workflow for building Docker images and deploying them to Kubernetes.

Installation

Add this line to your application's Gemfile:

gem 'dockerhelper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dockerhelper

Usage

Example usage in a Rakefile:

require 'dockerhelper'
require 'dockerhelper/rake'

project_root = File.expand_path('../../', __FILE__)
config = Dockerhelper.configure do |c|
  c.app_name                = 'project'
  c.environment             = :production
  c.git_repo_url            = '[email protected]:org/project.git'
  c.git_root                = File.join(project_root, 'tmp/repo')
  c.git_branch              = ENV['GIT_BRANCH'] || 'master'
  c.dockerfile              = 'docker/Dockerfile.production'
  c.docker_image            = 'project-image-name'
  c.docker_repo             = 'org/project'
  c.docker_repo_tag_prefix  = 'prd-'
  c.kube_rc_template        = File.expand_path('../project-rc.yml.erb', __FILE__)
  c.kube_rc_dest_dir        = File.dirname(__FILE__)
  c.env_vars                = %w(REQUIRED_ENV_VAR)
end

Dockerhelper::Tasks.init(config)

The above will define rake tasks, for example:

rake docker:production:build        # Build docker image
rake docker:production:deploy       # Git clone, build image, and push image to Docker Hub
rake docker:production:info         # Print config info
rake docker:production:kube:gen_rc  # Generate replication controller for the current build
rake docker:production:pull         # Pull git repo
rake docker:production:push         # Push docker images to Docker Hub
rake docker:production:repo_tag     # Tag docker image

dockerhelper's People

Contributors

joshm1 avatar keithlayne avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.