Class: Docker::Template::Scratch
- Defined in:
- lib/docker/template/scratch.rb
Constant Summary
Constants inherited from Common
Instance Attribute Summary collapse
-
#img ⇒ Object
readonly
Returns the value of attribute img.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#rootfs ⇒ Object
readonly
Returns the value of attribute rootfs.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(repo) ⇒ Scratch
constructor
A new instance of Scratch.
- #unlink(img: false) ⇒ Object
Methods inherited from Common
#aliased?, #build, #chdir_build, #parent_img, #parent_repo, #push, #rootfs?
Constructor Details
#initialize(repo) ⇒ Scratch
Returns a new instance of Scratch.
9 10 11 |
# File 'lib/docker/template/scratch.rb', line 9 def initialize(repo) @repo = repo end |
Instance Attribute Details
#img ⇒ Object (readonly)
Returns the value of attribute img.
8 9 10 |
# File 'lib/docker/template/scratch.rb', line 8 def img @img end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
8 9 10 |
# File 'lib/docker/template/scratch.rb', line 8 def repo @repo end |
#rootfs ⇒ Object (readonly)
Returns the value of attribute rootfs.
8 9 10 |
# File 'lib/docker/template/scratch.rb', line 8 def rootfs @rootfs end |
Instance Method Details
#data ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/docker/template/scratch.rb', line 15 def data Template.get(:scratch, { :maintainer => @repo.["maintainer"], :entrypoint => @repo.["entry"].fallback, :tar_gz => @tar_gz.basename }) end |
#unlink(img: false) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/docker/template/scratch.rb', line 25 def unlink(img: false) @copy.rmtree if @copy && @copy.directory? @img.delete "force" => true if @img && img @context.rmtree if @context && @context.directory? @tar_gz.unlink if @tar_gz && @tar_gz.file? end |