Allow setting the build context used for building
This commit is contained in:
@@ -12,6 +12,9 @@ class Mrsk::Commands::Builder::Base < Mrsk::Commands::Base
|
||||
def build_options
|
||||
[ *build_tags, *build_labels, *build_args, *build_secrets, *build_dockerfile ]
|
||||
end
|
||||
|
||||
def build_context
|
||||
context
|
||||
end
|
||||
|
||||
private
|
||||
@@ -46,4 +49,8 @@ class Mrsk::Commands::Builder::Base < Mrsk::Commands::Base
|
||||
def dockerfile
|
||||
(config.builder && config.builder["dockerfile"]) || "Dockerfile"
|
||||
end
|
||||
|
||||
def context
|
||||
(config.builder && config.builder["context"]) || "."
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ class Mrsk::Commands::Builder::Multiarch < Mrsk::Commands::Builder::Base
|
||||
"--platform", "linux/amd64,linux/arm64",
|
||||
"--builder", builder_name,
|
||||
*build_options,
|
||||
"."
|
||||
build_context
|
||||
end
|
||||
|
||||
def info
|
||||
|
||||
@@ -9,7 +9,7 @@ class Mrsk::Commands::Builder::Native < Mrsk::Commands::Builder::Base
|
||||
|
||||
def push
|
||||
combine \
|
||||
docker(:build, *build_options, "."),
|
||||
docker(:build, *build_options, build_context),
|
||||
docker(:push, config.absolute_image)
|
||||
end
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class Mrsk::Commands::Builder::Native::Remote < Mrsk::Commands::Builder::Native
|
||||
"--platform", platform,
|
||||
"--builder", builder_name,
|
||||
*build_options,
|
||||
"."
|
||||
build_context
|
||||
end
|
||||
|
||||
def info
|
||||
|
||||
Reference in New Issue
Block a user