Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Defining project name inside docker-compose configuration

Can you actually define the project name inside the compose configuration file itself, rather than as an environment variable or command-line flag? I suspect it may avoid some trouble in some scenarios.

I guess overriding that name might still be possible by env or flag.

like image 404
matanster Avatar asked Mar 02 '16 14:03

matanster


People also ask

How do I name a container in Docker Compose?

In docker-compose, you can do this by setting the “container_name” property on any of your containers.

How do I assign a container name in docker?

When a container is created using Docker, Docker provides a way to name the container using the the --name <container_name> flag. However, if no name is provided by the user while creating/running a Docker container, Docker automatically assigns the container a name.

What is Docker Compose configuration file?

The Compose file is a YAML file defining services, networks, and volumes for a Docker application. The latest and recommended version of the Compose file format is defined by the Compose Specification.

Where is the Docker Compose config file?

The default path for a Compose file is ./docker-compose.yml .


1 Answers

Not yet (as of version 1.6.2), however, it is being discussed https://github.com/docker/compose/issues/745

like image 148
dnephin Avatar answered Sep 21 '22 11:09

dnephin