class Panoramix::Plugin::DockerImage

Attributes

env[R]
src[R]

Public Class Methods

new(dst, src, host) click to toggle source
Calls superclass method
# File lib/panoramix/plugin/docker_image.rb, line 11
def initialize(dst, src, host)
        super(dst, host)
        @src = src
        @env = Hash.new
        @env["DOCKER_HOST"] = "tcp://#{host}" if host
end

Public Instance Methods

needed?(timestamps) click to toggle source

When this instance needs to be executed

# File lib/panoramix/plugin/docker_image.rb, line 19
def needed? timestamps
        true
end
ps() click to toggle source
Calls superclass method
# File lib/panoramix/plugin/docker_image.rb, line 35
def ps
        super ("Pulled image")
end
run_default() click to toggle source

Default action for this task

# File lib/panoramix/plugin/docker_image.rb, line 24
def run_default
        shell("docker pull #{@src}", false, @env) unless ENV["NO_PULL"]

        # Tag image with required tag
        shell("docker tag #{@src} #{@dst}", false, @env)

        # Remove origin image
        # shell("docker rmi #{@src}", false, @env)
        # It fails when the base image is in use.
end