diff --git a/local/compose.go b/local/compose.go index 3a0cb9868..5b2595533 100644 --- a/local/compose.go +++ b/local/compose.go @@ -363,10 +363,15 @@ func getContainerCreateOptions(p *types.Project, s types.ServiceConfig, number i if err != nil { return nil, nil, nil, err } + //TODO: change oneoffLabel value for containers started with `docker compose run` labels := map[string]string{ projectLabel: p.Name, serviceLabel: s.Name, + versionLabel: ComposeVersion, + oneoffLabel: "False", configHashLabel: hash, + workingDirLabel: p.WorkingDir, + configFilesLabel: strings.Join(p.ConfigNames(), ","), containerNumberLabel: strconv.Itoa(number), } diff --git a/local/labels.go b/local/labels.go index 24dee33f7..876482b90 100644 --- a/local/labels.go +++ b/local/labels.go @@ -25,10 +25,17 @@ import ( ) const ( - projectLabel = "com.docker.compose.project" - serviceLabel = "com.docker.compose.service" - configHashLabel = "com.docker.compose.config-hash" containerNumberLabel = "com.docker.compose.container-number" + oneoffLabel = "com.docker.compose.oneoff" + projectLabel = "com.docker.compose.project" + workingDirLabel = "com.docker.compose.project.working_dir" + configFilesLabel = "com.docker.compose.project.config_files" + serviceLabel = "com.docker.compose.service" + versionLabel = "com.docker.compose.version" + configHashLabel = "com.docker.compose.config-hash" + + //ComposeVersion Compose version + ComposeVersion = "1.0-alpha" ) func projectFilter(projectName string) filters.KeyValuePair {