@@ -82,7 +82,7 @@ func (s *composeService) down(ctx context.Context, projectName string, options a
82
82
ops := s .ensureNetworksDown (ctx , project , w )
83
83
84
84
if options .Images != "" {
85
- ops = append (ops , s .ensureImagesDown (ctx , projectName , options , w )... )
85
+ ops = append (ops , s .ensureImagesDown (ctx , project , options , w )... )
86
86
}
87
87
88
88
if options .Volumes {
@@ -114,9 +114,9 @@ func (s *composeService) ensureVolumesDown(ctx context.Context, project *types.P
114
114
return ops
115
115
}
116
116
117
- func (s * composeService ) ensureImagesDown (ctx context.Context , projectName string , options api.DownOptions , w progress.Writer ) []downOp {
117
+ func (s * composeService ) ensureImagesDown (ctx context.Context , project * types. Project , options api.DownOptions , w progress.Writer ) []downOp {
118
118
var ops []downOp
119
- for image := range s .getServiceImages (options , projectName ) {
119
+ for image := range s .getServiceImages (options , project ) {
120
120
image := image
121
121
ops = append (ops , func () error {
122
122
return s .removeImage (ctx , image , w )
@@ -144,15 +144,15 @@ func (s *composeService) ensureNetworksDown(ctx context.Context, project *types.
144
144
return ops
145
145
}
146
146
147
- func (s * composeService ) getServiceImages (options api.DownOptions , projectName string ) map [string ]struct {} {
147
+ func (s * composeService ) getServiceImages (options api.DownOptions , project * types. Project ) map [string ]struct {} {
148
148
images := map [string ]struct {}{}
149
- for _ , service := range options . Project .Services {
149
+ for _ , service := range project .Services {
150
150
image := service .Image
151
151
if options .Images == "local" && image != "" {
152
152
continue
153
153
}
154
154
if image == "" {
155
- image = getImageName (service , projectName )
155
+ image = getImageName (service , project . Name )
156
156
}
157
157
images [image ] = struct {}{}
158
158
}
0 commit comments