Merge pull request #786 from hundredwatt/add-target-option-to-builder

Add --target option to Builder to support multi-stage Docker builds
This commit is contained in:
Donal McBreen
2024-05-10 15:15:31 +01:00
committed by GitHub
3 changed files with 17 additions and 2 deletions

View File

@@ -83,6 +83,13 @@ class CommandsBuilderTest < ActiveSupport::TestCase
end
end
test "build target" do
builder = new_builder_command(builder: { "target" => "prod" })
assert_equal \
"-t dhh/app:123 -t dhh/app:latest --label service=\"app\" --file Dockerfile --target prod",
builder.target.build_options.join(" ")
end
test "build context" do
builder = new_builder_command(builder: { "context" => ".." })
assert_equal \