Module: Kamal::Commands::App::Containers

Included in:
Kamal::Commands::App
Defined in:
lib/kamal/commands/app/containers.rb

Instance Method Summary collapse

Instance Method Details

#list_container_namesObject



6
7
8
# File 'lib/kamal/commands/app/containers.rb', line 6

def list_container_names
  [ *list_containers, "--format", "'{{ .Names }}'" ]
end

#list_containersObject



2
3
4
# File 'lib/kamal/commands/app/containers.rb', line 2

def list_containers
  docker :container, :ls, "--all", *filter_args
end

#remove_container(version:) ⇒ Object



10
11
12
13
14
# File 'lib/kamal/commands/app/containers.rb', line 10

def remove_container(version:)
  pipe \
    container_id_for(container_name: container_name(version)),
    xargs(docker(:container, :rm))
end

#remove_containersObject



20
21
22
# File 'lib/kamal/commands/app/containers.rb', line 20

def remove_containers
  docker :container, :prune, "--force", *filter_args
end

#rename_container(version:, new_version:) ⇒ Object



16
17
18
# File 'lib/kamal/commands/app/containers.rb', line 16

def rename_container(version:, new_version:)
  docker :rename, container_name(version), container_name(new_version)
end