diff --git a/loader/loader_test.go b/loader/loader_test.go index 0ab4f6c19..a795c4f2c 100644 --- a/loader/loader_test.go +++ b/loader/loader_test.go @@ -949,10 +949,23 @@ services: image: db build: context: ./db + shm_size: 2gb ` configDetails := buildConfigDetails(dict, nil) - _, err := Load(configDetails) + actual, err := Load(configDetails) assert.NilError(t, err) + + wd, _ := os.Getwd() + assert.DeepEqual(t, actual.Services["web"].Build, &types.BuildConfig{ + Context: wd, + Dockerfile: "Dockerfile", + }) + + assert.DeepEqual(t, actual.Services["db"].Build, &types.BuildConfig{ + Context: wd + "/db", + Dockerfile: "Dockerfile", + ShmSize: types.UnitBytes(2 * 1024 * 1024 * 1024), + }) } func TestDeprecatedProperties(t *testing.T) { @@ -2748,7 +2761,7 @@ services: image: example/proxy build: ./proxy develop: - watch: + watch: # rebuild image and recreate service - path: ./proxy/proxy.conf action: sync+restart diff --git a/types/types.go b/types/types.go index 17229af19..a98cfb6bb 100644 --- a/types/types.go +++ b/types/types.go @@ -281,6 +281,7 @@ type BuildConfig struct { Network string `yaml:"network,omitempty" json:"network,omitempty"` Target string `yaml:"target,omitempty" json:"target,omitempty"` Secrets []ServiceSecretConfig `yaml:"secrets,omitempty" json:"secrets,omitempty"` + ShmSize UnitBytes `yaml:"shm_size,omitempty" json:"shm_size,omitempty"` Tags StringList `yaml:"tags,omitempty" json:"tags,omitempty"` Ulimits map[string]*UlimitsConfig `yaml:"ulimits,omitempty" json:"ulimits,omitempty"` Platforms StringList `yaml:"platforms,omitempty" json:"platforms,omitempty"`