Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change docker compose up name in Visual Studio 2019

When running a docker-compose.dcproj project from the Visual Studio 2019 (using regular F5 Debug) it automatically executes this command (unrelated parts removed): docker-compose -f -p dockercompose5867848916081622061 up How do I force to regenerate this hash dockercompose5867848916081622061 or replace it with my own value? The issue is that if the solution folder was copied from another project the containers are unable to respond to any incoming requests and just hang

UPD: changing this name didn't help me, getting a meaningful name would still be helpful though

like image 569
Oleg Golovkov Avatar asked Jan 23 '20 12:01

Oleg Golovkov


People also ask

Can we change name of Docker compose file?

For docker-compose , you can set the top level variable name to your desired project name.

How do I add Docker compose yml in Visual Studio?

In the Web API project, again right-click on the project node, and choose Add > Container Orchestrator Support. Choose Docker Compose, and then select the same target OS. In this step, Visual Studio will offer to create a Dockerfile.

Can docker work with Visual Studio 2019?

With Visual Studio 2019, you can use Docker Compose, Kubernetes, and Service Fabric as container orchestration services.


1 Answers

As of Visual Studio 16.9, you can use <DockerComposeProjectName>my-docker-compose-project</DockerComposeProjectName> in the dcproj file to specify the docker-compose project name.

See https://github.com/microsoft/DockerTools/issues/171

like image 160
Collin Stevens Avatar answered Sep 30 '22 05:09

Collin Stevens