mirror of
https://github.com/docker/compose.git
synced 2026-06-29 20:56:07 +00:00
Use DOCKER_DEFAULT_PLATFORM to determine platform when creating container
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
parent
053f20edab
commit
7bc27d441b
1 changed files with 6 additions and 2 deletions
|
|
@ -479,10 +479,14 @@ func (s *composeService) createMobyContainer(ctx context.Context, project *types
|
|||
if err != nil {
|
||||
return created, err
|
||||
}
|
||||
platform := service.Platform
|
||||
if platform == "" {
|
||||
platform = project.Environment["DOCKER_DEFAULT_PLATFORM"]
|
||||
}
|
||||
var plat *specs.Platform
|
||||
if service.Platform != "" {
|
||||
if platform != "" {
|
||||
var p specs.Platform
|
||||
p, err = platforms.Parse(service.Platform)
|
||||
p, err = platforms.Parse(platform)
|
||||
if err != nil {
|
||||
return created, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue