Giter Site home page Giter Site logo

erikh / box Goto Github PK

View Code? Open in Web Editor NEW

This project forked from box-builder/box

2.0 2.0 0.0 3.97 MB

A Next-Generation Builder for Docker Images - moved to box-builder/box

Home Page: https://github.com/box-builder/box

License: Other

Makefile 1.06% Ruby 1.75% Go 93.40% Shell 3.78%

box's Introduction

Box: A Next-Generation Builder for Docker Images

Build Status Join the chat at https://gitter.im/box-builder/Lobby Go Report Card

Box is a builder for docker that gives you the power of mruby, a limited, embeddable ruby. It allows for notions of conditionals, loops, and data structures for use within your builder plan. If you've written a Dockerfile before, writing a box build plan is easy.

  • Unique general features:

    • mruby syntax
    • filtering of keywords to secure builds
    • REPL (shell) for interactive building (see video below)
    • Multiple builds at once: build whole projects worth of images
  • In the build plan itself:

    • Tagging
    • Flattening
    • Debug mode (drop to a shell in the middle of a plan run and inspect your container)
    • Ruby block methods for user (with_user) and workdir (inside) allow you to scope copy and run operations for a more obvious build plan.
  • Extended Documentation for Syntax and Usage

Install

Using the Homebrew Tap

brew tap erikh/box && brew install erikh/box/box

Example

This will fetch the golang image, update APT, and then install the packages set in the packages variable. It then creates a user and copies the dir to its homedir. If an environment value is provided, it will be used. Then it will tag the whole image as mypackages.

Save it to plan.rb and run it with box plan.rb. Box only copies what it needs to; your whole directory won't be uploaded to docker.

from "golang"

packages = "build-essential g++ git wget curl ruby bison flex"

run "apt-get update"
run "apt-get install -y #{packages}"

run %q[useradd -m -d /home/erikh -s /bin/bash erikh]

inside "/home/erikh" do
  copy((getenv("MYDIR") || "."), ".")
end

tag "mypackages"

Video

Here's a video of the shell in action (click for more):

Available in v0.3 and up

Box REPL

Advanced Use

The documentation is the best resource for learning the different verbs and functions. However, check out our own build plan for box for an example of how to use different predicates, functions, and verbs to get everything you need out of it.

Development Instructions

  • Requires: compiler, bison, flex, and libgpgme, libdevmapper, btrfs headers.
  • go get -d github.com/erikh/box && cd $GOPATH/src/github.com/erikh/box
  • To build on the host (create a dev environment):
    • make
  • To build a docker image for your dev environment (needed for test and release builds):
    • make build
  • If you have a dev environment:
    • make test
  • To do a release build:
    • VERSION=<version> make release

box's People

Contributors

capoferro avatar cmaujean avatar errordeveloper avatar gitter-badger avatar shift avatar unclejack avatar

Stargazers

 avatar  avatar

Watchers

 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.