Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot locate specified Dockerfile: DockerTest\Dockerfile #103

Closed
hodgsopg opened this issue May 19, 2018 · 11 comments
Closed

Cannot locate specified Dockerfile: DockerTest\Dockerfile #103

hodgsopg opened this issue May 19, 2018 · 11 comments
Labels
stale Stale issues--reopen if desired

Comments

@hodgsopg
Copy link

I installed docker for windows (edge version) Version 18.05.0-ce-win66 (17760).
I have Visual Studio 15.7.1.
I created a dot net core console app.
I added Docker support to the project targeting Linux.
When I try and run it is says this:
1>------ Build started: Project: docker-compose, Configuration: Debug Any CPU ------ 1>docker ps --filter "status=running" --filter "name=dockercompose18093898453904356706_dockertest_" --format {{.ID}} -n 1 1>DockerTest -> E:\dev\prydain2\netcore\DockerTest\DockerTest\bin\Debug\netcoreapp2.0\DockerTest.dll 1>docker-compose -f "E:\dev\prydain2\netcore\DockerTest\docker-compose.yml" -f "E:\dev\prydain2\netcore\DockerTest\docker-compose.override.yml" -f "E:\dev\prydain2\netcore\DockerTest\obj\Docker\docker-compose.vs.debug.g.yml" -p dockercompose18093898453904356706 --no-ansi up -d --build --force-recreate --remove-orphans 1>The DOCKER_REGISTRY variable is not set. Defaulting to a blank string. 1>Building dockertest 1>Cannot locate specified Dockerfile: DockerTest\Dockerfile 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : The DOCKER_REGISTRY variable is not set. Defaulting to a blank string. 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : Building dockertest 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : Cannot locate specified Dockerfile: DockerTest\Dockerfile. 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : For more troubleshooting information, go to http://aka.ms/DockerToolsTroubleshooting 1>Done building project "docker-compose.dcproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

This is a very basic example, surely this should just work.
But the troubleshooting guide and the tutorial say nothing about what is going on.

PHilip

@Sam-Vimes
Copy link

I have the same problem, with an existing solution that was working fine, until I installed the VS 15.7.1 update and the 18.05.0-ce-win66 (17760) Docker update.

@aauronn
Copy link

aauronn commented May 21, 2018

Same for me

@loxymartin
Copy link

Same problem for me too. Occurrs on both new and existing projects after upgrading to VS 15.7.1

@Sam-Vimes
Copy link

I eventually fixed it by doing both of the following:

  • In docker-compose.yml, I changed instances of
    build:
      context: .
      dockerfile: FolderName/Dockerfile

to

    build:
      context: FolderName
      dockerfile: Dockerfile

(in other words I moved the "folder" portion of the path to the Dockerfile to the context element instead).

  • Performing a solution clean, followed by a manual delete of all bin and obj folders.

@aperevalov
Copy link

The same problem with VS 15.7.2 and docker engine 18.05.0-ce

@haniamr
Copy link

haniamr commented May 23, 2018

Looks like an issue with docker-compose 1.21.2: docker/compose#5969

@torbenj
Copy link

torbenj commented Jun 2, 2018

Got the same issue with Visual Studio 2017 15.7.3 and 18.05.0 (didn't write down the exact version, but it was one of the edge channel).
To fix it I uninstalled 18.05 and installed a stable version (18.03.1-ce-win65 17513) from the official website.
Now it works without modifying the docker-compose.yml file.

@p10tyr
Copy link

p10tyr commented Jun 18, 2018

@torbenj I have this issue with 15.7.3 and 18.03.1-ce-win65 17513 (stable channel)

@Sam-Vimes that did not fix it for me either

Anybody know what the fix is?

@p10tyr
Copy link

p10tyr commented Jun 18, 2018

Turns out the message is a false positive?

image

I notice this in the output window

docker-compose  -f "C:\Code\docker-compose.yml" -f "C:\Code\docker-compose.override.yml" -f "C:\Code\obj\Docker\docker-compose.vs.debug.g.yml" -p dockercompose17647390188703866222 --no-ansi up -d --build --force-recreate --remove-orphans
1>The DOCKER_REGISTRY variable is not set. Defaulting to a blank string.

The actual error message is above this one

1>The DOCKER_REGISTRY variable is not set. Defaulting to a blank string.
1>Creating dockercompose17647390188703866222_persistentsubscriber_1 ...
1>Creating dockercompose17647390188703866222_persistentsubscriber_1 ... error
1>ERROR: for dockercompose17647390188703866222.persistentsubscriber_1  Cannot create container for service persistentsubscriber: Conflict. The container name "/dockercompose17647390188703866222_persistentsubscriber_1" is already in use by container "60395aeec84c3285579b52f5a26878cf51598beb6448e0ce2d3124a6aebb23bc". You have to remove (or rename) that container to be able to reuse that name.
1>ERROR: for persistentsubscriber  Cannot create container for service persistentsubscriber: Conflict. The container name "/dockercompose17647390188703866222_persistentsubscriber_1" is already in use by container "60395aeec84c3285579b52f5a26878cf51598beb6448e0ce2d3124a6aebb23bc". You have to remove (or rename) that container to be able to reuse that name.
1>Encountered errors while bringing up the project.

Do i have to go and manually delete the docker every time i want to debug... that is like more than 10 times a day.

Is this tool supposed to update the container instead?
I can see it says --force-recreate so why is it complaining?
When I try rebuild and clean on the docker-compose I get the same visual studio error as posted.

@cmjchrisjones
Copy link

I had this issue, tried @Sam-Vimes fix but my solution wouldn't clean or build.

It turns out I had previously added a second project to my solution which also had docker support, however I deleted it again however my docker-compose.yml and docker-compose.override.yml still had references to these images and hey presto, my solution built :)

@bwateratmsft bwateratmsft added the stale Stale issues--reopen if desired label Jan 23, 2019
@bwateratmsft
Copy link
Contributor

This issue is being closed as an inactive issue. If you wish to keep it active, please let us know, we are happy to take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issues--reopen if desired
Projects
None yet
Development

No branches or pull requests

10 participants