Skip to content

Numergy/container-cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Antoine Rouyer
Apr 8, 2016
0e3ce38 · Apr 8, 2016

History

86 Commits
Apr 8, 2016
Apr 8, 2016
Apr 8, 2016
Apr 8, 2016
Apr 7, 2016
Apr 8, 2016
Mar 6, 2015
Jun 25, 2015
Dec 22, 2014
Jun 25, 2015
Apr 7, 2016
Apr 7, 2016
Feb 3, 2015
Jun 25, 2015
Apr 8, 2016
Nov 13, 2014
Apr 8, 2016
Nov 15, 2014
Apr 8, 2016
Apr 8, 2016
Jun 25, 2015
Apr 8, 2016

Repository files navigation

Container Cookbook

The Chef cookbook to build Docker containers for CI/CD workflows. Build Status

Usage

This cookbook provides some recipes to init and build containers.

Provided recipes are:

  • ndenv
  • phpenv
  • pyenv
  • rbenv
  • jenv

Example to build a container:

With Rake

This method only works if you have docker installed on your system.

$ bundle install
$ bundle exec rake container:create_ruby #-> or simply `create` to create all containers
$ bundle exec rake container:deploy_ruby[my_registry.com] #-> or simply `deploy` to deploy container to `my_registry.com`

It's also possible to directly create and deploy all containers.

$ bundle install
$ bundle exec rake container:all[my_registry.com]

With vagrant

$ vagrant up
...
$ vagrant ssh
vagrant@vagrant:~$ sudo -i
root@vagrant:~# cd /vagrant
root@vagrant:~# bundle exec berks vendor
root@vagrant:~# bundle exec rake container:create
You now have a docker image:
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ci_ruby             latest              f8290ef73660        7 minutes ago       722.4 MB
Running our container:
$ docker run -t -i --entrypoint "/bin/bash" ci_ruby --login -c "rbenv versions"
* 1.9.3-p547 (set by /opt/rbenv/version)
  2.0.0-p598
  2.1.0
  2.1.5

More info about containers with chef: https://docs.chef.io/containers.html

License and Authors

Authors:

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.