Sha256: da1286041430ee4b2fcdafc6317cdbe54094df680dff4325f28f7d4b3b34b892
Contents?: true
Size: 1005 Bytes
Versions: 7
Compression:
Stored size: 1005 Bytes
Contents
# frozen_string_literal: true module Bauble module Cli # Builds a docker command class DockerCommandBuilder def initialize @command = 'docker run ' end def with_rm @command += '--rm ' self end def with_volume(volume) @command += "-v #{volume} " self end def with_workdir(workdir) @command += "-w #{workdir} " self end def with_entrypoint(entrypoint) @command += "--entrypoint #{entrypoint} " self end def with_platform(platform) @command += "--platform #{platform} " self end def with_image(image) @command += "#{image} " self end def with_command(cmd) @command += %(-c "#{cmd.gsub('"', '\"')}" ) self end def with_env(key, value) @command += "-e #{key}=#{value} " self end def build @command.strip end end end end
Version data entries
7 entries across 7 versions & 1 rubygems