mirror of https://github.com/docker/compose.git
Merge pull request #10099 from laurazard/use-defaultplatform-create
Use `DOCKER_DEFAULT_PLATFORM` to determine platform when creating container
This commit is contained in:
commit
1e682a40ac
|
@ -479,10 +479,14 @@ func (s *composeService) createMobyContainer(ctx context.Context, project *types
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return created, err
|
return created, err
|
||||||
}
|
}
|
||||||
|
platform := service.Platform
|
||||||
|
if platform == "" {
|
||||||
|
platform = project.Environment["DOCKER_DEFAULT_PLATFORM"]
|
||||||
|
}
|
||||||
var plat *specs.Platform
|
var plat *specs.Platform
|
||||||
if service.Platform != "" {
|
if platform != "" {
|
||||||
var p specs.Platform
|
var p specs.Platform
|
||||||
p, err = platforms.Parse(service.Platform)
|
p, err = platforms.Parse(platform)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return created, err
|
return created, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue