Inroduce Native::Cached builder

This commit is contained in:
Igor Alexandrov
2023-06-18 22:45:04 +04:00
parent 4df3389d09
commit aa28ee0f3e
4 changed files with 41 additions and 26 deletions

View File

@@ -1,32 +1,17 @@
class Mrsk::Commands::Builder::Native < Mrsk::Commands::Builder::Base
def create
# No-op on native without cache
if config.builder.cache?
docker :buildx, :create, "--use", "--driver=docker-container"
end
end
def remove
# No-op on native without cache
if config.builder.cache?
docker :buildx, :rm, builder_name
end
end
def push
if config.builder.cache?
docker :buildx, :build,
"--push",
*build_options,
build_context
else
combine \
docker(:build, *build_options, build_context),
docker(:push, config.absolute_image),
docker(:push, config.latest_image)
end
combine \
docker(:build, *build_options, build_context),
docker(:push, config.absolute_image),
docker(:push, config.latest_image)
end
def info