Sha256: 025c2c294dd5dbc14dd61285caa3a660cc3a0985eb0ff53038e5aa70b42d8262

Contents?: true

Size: 884 Bytes

Versions: 27

Compression:

Stored size: 884 Bytes

Contents

# frozen_string_literal: true

# takelage docker container check existing
module DockerContainerCheckExisting
  # Backend method for docker container check existing.
  # @return [Boolean] is container existing?
  def docker_container_check_existing(container)
    log.debug "Checking if container \"#{container}\" is existing"

    return false unless docker_check_daemon

    stdout_str = run _docker_container_cmd_check_existing container

    if stdout_str.to_s.chomp.empty?
      log.debug "Container \"#{container}\" is not existing"
      return false
    end

    log.debug "Container \"#{container}\" is existing"
    true
  end

  private

  # Format command to check if docker container exists.
  def _docker_container_cmd_check_existing(container)
    format(
      config.active['cmd_docker_container_check_existing_docker_ps'],
      container: container
    )
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
takelage-0.33.1 lib/takelage/docker/container/check/existing.rb
takelage-0.32.4 lib/takelage/docker/container/check/existing.rb
takelage-0.32.3 lib/takelage/docker/container/check/existing.rb
takelage-0.32.1 lib/takelage/docker/container/check/existing.rb
takelage-0.32.0 lib/takelage/docker/container/check/existing.rb
takelage-0.31.0 lib/takelage/docker/container/check/existing.rb
takelage-0.30.6 lib/takelage/docker/container/check/existing.rb
takelage-0.30.5 lib/takelage/docker/container/check/existing.rb
takelage-0.30.1 lib/takelage/docker/container/check/existing.rb
takelage-0.30.0 lib/takelage/docker/container/check/existing.rb
takelage-0.29.14 lib/takelage/docker/container/check/existing.rb
takelage-0.29.13 lib/takelage/docker/container/check/existing.rb
takelage-0.29.11 lib/takelage/docker/container/check/existing.rb
takelage-0.29.10 lib/takelage/docker/container/check/existing.rb
takelage-0.29.8 lib/takelage/docker/container/check/existing.rb
takelage-0.29.6 lib/takelage/docker/container/check/existing.rb
takelage-0.29.0 lib/takelage/docker/container/check/existing.rb
takelage-0.28.26 lib/takelage/docker/container/check/existing.rb
takelage-0.28.24 lib/takelage/docker/container/check/existing.rb
takelage-0.28.14 lib/takelage/docker/container/check/existing.rb