Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'rm' attribute to image resource. #46

Merged
merged 1 commit into from
Jan 20, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ image_url (*DEPRECATED*) | URL to grab image | String | nil
path (*DEPRECATED*) | Local path to files | String | nil
source | Source dockerfile/directory/URL to build | String | nil
tag | Optional tag for image | String | nil
rm | Remove intermediate containers after a successful build | TrueClass, FalseClass | false

Build image from Dockerfile:

Expand Down
2 changes: 1 addition & 1 deletion providers/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def build
command = new_resource.source
end

docker_cmd("build -t #{full_image_name} #{command}")
docker_cmd("build -rm=#{new_resource.rm} -t #{full_image_name} #{command}")
end

def docker_cmd(cmd, timeout = new_resource.cmd_timeout)
Expand Down
1 change: 1 addition & 0 deletions resources/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
attribute :repository, :kind_of => [String]
attribute :source, :kind_of => [String]
attribute :tag, :kind_of => [String]
attribute :rm, :kind_of => [TrueClass, FalseClass], :default => false