Skip to content

Commit 03aadcc

Browse files
authored
Merge pull request docker#9368 from ndeloof/links_dependencies
include services declared by `links` as implicit dependencies
2 parents db69856 + 500555b commit 03aadcc

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

pkg/compose/build_classic.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,8 @@ func (s *composeService) doBuildClassicSimpleImage(ctx context.Context, options
143143
return "", err
144144
}
145145

146-
// if up to this point nothing has set the context then we must have another
147-
// way for sending it(streaming) and set the context to the Dockerfile
148-
if dockerfileCtx != nil && buildCtx == nil {
149-
buildCtx = dockerfileCtx
150-
}
151-
152146
progressOutput := streamformatter.NewProgressOutput(progBuff)
153-
var body io.Reader
154-
if buildCtx != nil {
155-
body = progress.NewProgressReader(buildCtx, progressOutput, 0, "", "Sending build context to Docker daemon")
156-
}
147+
body := progress.NewProgressReader(buildCtx, progressOutput, 0, "", "Sending build context to Docker daemon")
157148

158149
configFile := s.configFile()
159150
creds, err := configFile.GetAllCredentials()

pkg/compose/create.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ func prepareServicesDependsOn(p *types.Project) error {
173173
dependencies = append(dependencies, spec[0])
174174
}
175175

176+
for _, link := range service.Links {
177+
dependencies = append(dependencies, strings.Split(link, ":")[0])
178+
}
179+
176180
if len(dependencies) == 0 {
177181
continue
178182
}

0 commit comments

Comments
 (0)