Dockerchain
Build a series of docker images from a set of dockerfiles, chaining the output of one into the next.
Installation
git clone git@github.com:jeremiahishere/dockerchain.git
cd dockerchain
bundle install
If necessary, clone git@github.com:jeremiahishere/dockerfile_ast.git and manually install it.
Usage
write a yml file similar to sshable.yml. The script will automatically prepend the image_name field with 'dockerchain/'. The repos should have a Dockerfile in their root directory and must be available to the current user.
run bundle exec dockerchain path/to/my_config_file.yml
How it works
-
Write a yaml file if records that look like this
- image_name: sshable repo_url: https://github.com/imightbeinatree/docker-sshable.git
-
Install the
dockerfile_ast
gem located at http://github.com/jeremiahishere/dockerfile_ast -
Parse the yaml file and loop through the repos
- clone the first repo into the repos directory
- run
docker build -t dockerchain/<image_name>
on the dockerfile in the directory - go to the next directory
- run
ruby replace_dockerfile_from.rb /path/to_dockerfile previous_build_name
on the Dockerfile in the repo - run
docker build -e dockerchain/<second_image_name>
on the new dockerfile - repeat 3.1 through 3.5 on all of the repos in the yaml file, changing the image name for each one
Contributing
- Fork it ( http://github.com//dockerchain/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request