Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit a5b3f56

Browse files
committed
Tag service image as name:version-service
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 4c12639 commit a5b3f56

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

internal/commands/build/compose.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func parseCompose(app *types.App, options buildOptions) (map[string]build.Option
4444
BuildArgs: flatten(service.Build.Args),
4545
NoCache: options.noCache,
4646
Pull: options.pull,
47+
Tags: []string{fmt.Sprintf("%s:%s-%s", app.Metadata().Name, app.Metadata().Version, service.Name)},
4748
}
4849
}
4950
return opts, nil

internal/commands/build/compose_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func Test_parseCompose(t *testing.T) {
2424
ContextPath: "testdata/web",
2525
DockerfilePath: "testdata/web/Dockerfile",
2626
},
27+
Tags: []string{"simple:1.1.0-beta1-web"},
2728
},
2829
},
2930
{
@@ -34,6 +35,7 @@ func Test_parseCompose(t *testing.T) {
3435
ContextPath: "testdata/web",
3536
DockerfilePath: "testdata/web/Dockerfile.custom",
3637
},
38+
Tags: []string{"context:1.1.0-beta1-web"},
3739
},
3840
},
3941
{
@@ -45,6 +47,7 @@ func Test_parseCompose(t *testing.T) {
4547
DockerfilePath: "testdata/web/Dockerfile",
4648
},
4749
BuildArgs: map[string]string{"foo": "bar"},
50+
Tags: []string{"withargs:1.1.0-beta1-web"},
4851
},
4952
},
5053
}

internal/commands/build/testdata/context.dockerapp/metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: 1.1.0-beta1
2-
name: simple
2+
name: context
33
description: "new fancy webapp with microservices"
44
maintainers:
55
- name: John Developer

internal/commands/build/testdata/withargs.dockerapp/metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: 1.1.0-beta1
2-
name: simple
2+
name: withargs
33
description: "new fancy webapp with microservices"
44
maintainers:
55
- name: John Developer

0 commit comments

Comments
 (0)