Sha256: 8679f115a77ee8f1616387222ac5db51325ff98aad69c46860cd20d246d142ad

Contents?: true

Size: 782 Bytes

Versions: 11

Compression:

Stored size: 782 Bytes

Contents

class Kamal::Commands::Builder::Multiarch < Kamal::Commands::Builder::Base
  def create
    docker :buildx, :create, "--use", "--name", builder_name
  end

  def remove
    docker :buildx, :rm, builder_name
  end

  def info
    combine \
      docker(:context, :ls),
      docker(:buildx, :ls)
  end

  def push
    docker :buildx, :build,
      "--push",
      "--platform", platform_names,
      "--builder", builder_name,
      *build_options,
      build_context
  end

  def context_hosts
    docker :buildx, :inspect, builder_name, "> /dev/null"
  end

  private
    def builder_name
      "kamal-#{config.service}-multiarch"
    end

    def platform_names
      if local_arch
        "linux/#{local_arch}"
      else
        "linux/amd64,linux/arm64"
      end
    end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kamal-1.9.2 lib/kamal/commands/builder/multiarch.rb
kamal-1.9.1 lib/kamal/commands/builder/multiarch.rb
kamal-1.9.0 lib/kamal/commands/builder/multiarch.rb
kamal-1.8.3 lib/kamal/commands/builder/multiarch.rb
kamal-1.8.2 lib/kamal/commands/builder/multiarch.rb
kamal-1.8.1 lib/kamal/commands/builder/multiarch.rb
kamal-1.8.0 lib/kamal/commands/builder/multiarch.rb
kamal-1.7.3 lib/kamal/commands/builder/multiarch.rb
kamal-1.7.2 lib/kamal/commands/builder/multiarch.rb
kamal-1.7.1 lib/kamal/commands/builder/multiarch.rb
kamal-1.7.0 lib/kamal/commands/builder/multiarch.rb