Signed-off-by: Laura Brehm <[email protected]>
@@ -142,6 +142,10 @@ func (o *projectOptions) projectOrName() (*types.Project, string, error) {
if o.ProjectName == "" {
p, err := o.toProject(nil)
if err != nil {
+ envProjectName := os.Getenv("COMPOSE_PROJECT_NAME")
+ if envProjectName != "" {
+ return nil, envProjectName, nil
+ }
return nil, "", err
}
project = p
@@ -2,4 +2,4 @@ services:
a-different-one:
image: nginx:alpine
and-another-one:
- image: nginx:alpine
+ image: nginx:alpine