Class: Docker::Template::Rootfs
- Defined in:
- lib/docker/template/rootfs.rb
Constant Summary
Constants inherited from Common
Instance Attribute Summary collapse
-
#img ⇒ Object
readonly
Returns the value of attribute img.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(repo) ⇒ Rootfs
constructor
A new instance of Rootfs.
- #rootfs? ⇒ Boolean
-
#unlink(img: true) ⇒ Object
In a typical situation we do not remove the rootfs img and don’t recommend removing it as it’s better cached by Docker, if you wish to delete it we will.
Methods inherited from Common
#aliased?, #build, #chdir_build, #parent_img, #parent_repo, #push
Constructor Details
#initialize(repo) ⇒ Rootfs
Returns a new instance of Rootfs.
9 10 11 |
# File 'lib/docker/template/rootfs.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/rootfs.rb', line 8 def img @img end |
Instance Method Details
#data ⇒ Object
21 22 23 24 25 |
# File 'lib/docker/template/rootfs.rb', line 21 def data Template.get(:rootfs, { :rootfs_base_img => @repo.["rootfs_base_img"] }) end |
#rootfs? ⇒ Boolean
15 16 17 |
# File 'lib/docker/template/rootfs.rb', line 15 def rootfs? true end |
#unlink(img: true) ⇒ Object
In a typical situation we do not remove the rootfs img and don’t recommend removing it as it’s better cached by Docker, if you wish to delete it we will. Now, here we only remove it if we get told to exit, since we will be in the middle of a build and probably not have tagged yet, unless we are downstream, we will remove it so you have no broken images on your system.
34 35 36 37 38 39 40 |
# File 'lib/docker/template/rootfs.rb', line 34 def unlink(img: true) keep = @repo.["keep_rootfs"] @img.delete "force" => true if img && @img && !keep @context.rmtree if @context && @context.directory? rescue Docker::Error::NotFoundError nil end |