Class: Docker::Template::Simple

Inherits:
Common show all
Defined in:
lib/docker/template/simple.rb

Constant Summary

Constants inherited from Common

Common::CopyMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Common

#aliased?, #build, #chdir_build, #parent_img, #parent_repo, #push, #rootfs?

Constructor Details

#initialize(repo) ⇒ Simple



9
10
11
# File 'lib/docker/template/simple.rb', line 9

def initialize(repo)
  @repo = repo
end

Instance Attribute Details

#repoObject (readonly)

Returns the value of attribute repo.



8
9
10
# File 'lib/docker/template/simple.rb', line 8

def repo
  @repo
end

Instance Method Details

#setup_contextObject



30
31
32
33
34
35
# File 'lib/docker/template/simple.rb', line 30

def setup_context
  @context = @repo.tmpdir
  @copy = @context.join("copy")
  copy_dockerfile
  @copy.mkdir
end

#syncObject



15
16
17
18
# File 'lib/docker/template/simple.rb', line 15

def sync
  copy_build_and_verify unless @context
  Util.create_dockerhub_context(self, @context)
end


22
23
24
25
26
# File 'lib/docker/template/simple.rb', line 22

def unlink(img: false, sync: true)
  @img.delete "force" => true if @img && img
  @context.rmtree if @context && @context.directory?
  self.sync if sync && @repo.syncable?
end