mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 18:13:42 +08:00 
			
		
		
		
	bake: fix platforms field in compose yaml
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
		@@ -177,6 +177,7 @@ func ParseCompose(cfgs []composetypes.ConfigFile, envs map[string]string) (*Conf
 | 
			
		||||
				CacheFrom:   cacheFrom,
 | 
			
		||||
				CacheTo:     cacheTo,
 | 
			
		||||
				NetworkMode: networkModeP,
 | 
			
		||||
				Platforms:   s.Build.Platforms,
 | 
			
		||||
				SSH:         ssh,
 | 
			
		||||
				Secrets:     secrets,
 | 
			
		||||
				ShmSize:     shmSize,
 | 
			
		||||
 
 | 
			
		||||
@@ -463,6 +463,21 @@ services:
 | 
			
		||||
	require.NoError(t, err)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestPlatforms(t *testing.T) {
 | 
			
		||||
	dt := []byte(`
 | 
			
		||||
services:
 | 
			
		||||
  foo:
 | 
			
		||||
    build:
 | 
			
		||||
      context: .
 | 
			
		||||
      platforms:
 | 
			
		||||
        - linux/amd64
 | 
			
		||||
        - linux/arm64
 | 
			
		||||
`)
 | 
			
		||||
	c, err := ParseCompose([]composetypes.ConfigFile{{Content: dt}}, nil)
 | 
			
		||||
	require.NoError(t, err)
 | 
			
		||||
	require.Equal(t, []string{"linux/amd64", "linux/arm64"}, c.Targets[0].Platforms)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func newBool(val bool) *bool {
 | 
			
		||||
	b := val
 | 
			
		||||
	return &b
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user