Skip to content

Commit

Permalink
Docker 0.10.0: Add --input flag to docker load, closes #118
Browse files Browse the repository at this point in the history
  • Loading branch information
bflad committed Apr 13, 2014
1 parent a12c58f commit de2eb7a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Attributes now available for all docker daemon flags as well as system IP forwar
* REMOVED: container_dns* attributes (use replacement dns* attributes on daemon for all containers or docker_container dns* attributes instead)
* DEPRECATED: bind_* attributes to match docker terminology (use host attribute instead)
* Enhancement: [#115][]: Add IP forwarding attributes
* Enhancement: [#118][]: Docker 0.10.0: Add --input flag to docker load
* Enhancement: [#119][]: Docker 0.10.0: Add support for --env-file to load environment variables from files
* Enhancement: [#124][]: Add all docker daemon options as attributes
* Enhancement: [#125][]: Use dns* attributes to set docker daemon options, not defaults per-container
Expand Down Expand Up @@ -446,6 +447,7 @@ Lots of community contributions this release -- thanks!
[#112]: https://github.com/bflad/chef-docker/issues/112
[#113]: https://github.com/bflad/chef-docker/issues/113
[#115]: https://github.com/bflad/chef-docker/issues/115
[#118]: https://github.com/bflad/chef-docker/issues/118
[#119]: https://github.com/bflad/chef-docker/issues/119
[#124]: https://github.com/bflad/chef-docker/issues/124
[#125]: https://github.com/bflad/chef-docker/issues/125
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,19 @@ These attributes are associated with this LWRP action.

Attribute | Description | Type | Default
----------|-------------|------|--------
source | Source path/URL | String | nil
input | Image source (via tar archive file) | String | nil
source | Image source (via stdin) | String | nil

Load repository via input:

```ruby
docker_image 'test' do
input '/path/to/test.tar'
action :load
end
```

Load repository from path:
Load repository via stdin:

```ruby
docker_image 'test' do
Expand Down
9 changes: 8 additions & 1 deletion providers/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,14 @@ def installed?
end

def load
docker_cmd!("load < #{new_resource.source}")
if new_resource.input
load_args = cli_args(
'input' => new_resource.input
)
docker_cmd!("load #{load_args}")
else
docker_cmd!("load < #{new_resource.source}")
end
end

def pull
Expand Down
1 change: 1 addition & 0 deletions resources/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
attribute :id, :kind_of => [String]
# DEPRECATED: Use source attribute
attribute :image_url, :kind_of => [String]
attribute :input, :kind_of => [String]
attribute :no_cache, :kind_of => [TrueClass, FalseClass], :default => false
# DEPRECATED: Use source attribute
attribute :path, :kind_of => [String]
Expand Down

0 comments on commit de2eb7a

Please sign in to comment.