Add NetworkMode to bake target

Allows specification of network mode in a bake target.

Fixes #848

Signed-off-by: Zachary Povey <zachary.povey@autotrader.co.uk>
This commit is contained in:
Zachary Povey
2021-11-25 11:35:10 +00:00
parent ab73275f58
commit ae53101e89
5 changed files with 27 additions and 8 deletions

View File

@ -19,6 +19,8 @@ services:
build:
context: ./dir
dockerfile: Dockerfile-alternate
network:
none
args:
buildno: 123
`)
@ -43,6 +45,7 @@ services:
require.Equal(t, "Dockerfile-alternate", *c.Targets[1].Dockerfile)
require.Equal(t, 1, len(c.Targets[1].Args))
require.Equal(t, "123", c.Targets[1].Args["buildno"])
require.Equal(t, "none", *c.Targets[1].NetworkMode)
}
func TestNoBuildOutOfTreeService(t *testing.T) {