dockly 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -99,8 +99,12 @@ The `build_cache` DSL is used to prevent rebuilding assets every build and used
99
99
 
100
100
  The `docker` DSL is used to define Docker containers. It has the following attributes:
101
101
 
102
+ - `registry_import`
103
+ - required: `false` -- only required when `import` is not supplied
104
+ - description: the location of the base image to start building from
105
+ - examples: `paintedfox/ruby`, `registry.example.com/my-custom-image`
102
106
  - `import`
103
- - required: `true`
107
+ - required: `false` -- only required when `registry_import` is not supplied
104
108
  - description: the location (url or S3 path) of the base image to start building from
105
109
  - `git_archive`:
106
110
  - required: `false`
@@ -17,7 +17,7 @@ class Dockly::Docker
17
17
  dsl_class_attribute :registry, Dockly::Docker::Registry
18
18
 
19
19
  dsl_attribute :name, :import, :git_archive, :build, :tag, :build_dir, :package_dir,
20
- :timeout, :cleanup_images
20
+ :timeout, :cleanup_images, :registry_import
21
21
 
22
22
  default_value :tag, nil
23
23
  default_value :build_dir, 'build/docker'
@@ -27,11 +27,16 @@ class Dockly::Docker
27
27
 
28
28
  def generate!
29
29
  Docker.options = { :read_timeout => timeout, :write_timeout => timeout }
30
- docker_tar = File.absolute_path(ensure_tar(fetch_import))
31
-
32
30
  images = {}
33
31
 
34
- images[:one] = import_base(docker_tar)
32
+ if registry_import.nil?
33
+ docker_tar = File.absolute_path(ensure_tar(fetch_import))
34
+ images[:one] = import_base(docker_tar)
35
+ else
36
+ registry.authenticate! unless registry.nil?
37
+ images[:one] = ::Docker::Image.create('fromImage' => registry_import)
38
+ end
39
+
35
40
  images[:two] = add_git_archive(images[:one])
36
41
  images[:three] = run_build_caches(images[:two])
37
42
  images[:four] = build_image(images[:three])
@@ -1,3 +1,3 @@
1
1
  module Dockly
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Dockly::Docker::Registry, :current do
3
+ describe Dockly::Docker::Registry do
4
4
  subject { described_class.new(:name => :dockly_registry) }
5
5
 
6
6
  describe '#authenticate!' do
@@ -213,7 +213,7 @@ describe Dockly::Docker do
213
213
  context 'when there is a registry' do
214
214
  subject {
215
215
  Dockly::Docker.new do
216
- import 'https://s3.amazonaws.com/swipely-pub/docker-export-ubuntu-latest.tgz'
216
+ registry_import 'nahiluhmot/base'
217
217
  git_archive '.'
218
218
  build "run touch /it_worked"
219
219
  repository 'dockly_test'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-18 00:00:00.000000000 Z
12
+ date: 2014-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp