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

Task to execute Docker Images build is undefined #1647

Closed
prateikjaiswal opened this issue Feb 23, 2020 · 3 comments · Fixed by #1639
Closed

Task to execute Docker Images build is undefined #1647

prateikjaiswal opened this issue Feb 23, 2020 · 3 comments · Fixed by #1639

Comments

@prateikjaiswal
Copy link

Does this occur consistently? Yes
Repro steps:

  1. In Visual Studio Code open Command Palette
  2. Run command => Docker Images: build image
  3. Select workspace

Action: vscode-docker.images.build
Error type: 5
Error Message: Task to execute is undefined

Version: 0.10.0
OS: darwin
OS Release: 19.3.0
Product: Visual Studio Code - Insiders
Product Version: 1.43.0-insider
Language: en

@bwateratmsft
Copy link
Collaborator

Thanks @prateikjaiswal, this looks similar to the later issue found in #1474.

@bwateratmsft
Copy link
Collaborator

I think the root cause of this particular bug is that calling vscode.tasks.executeTask on workspace-defined tasks fails, with that error. Our plan for #1474 was to only ever scaffold workspace folder tasks, which resolves this particular error, but still leaves another problem:

  1. Create a workspace with multiple folders, each with a Dockerfile, both called "Dockerfile"
  2. Add Docker build tasks for only one of those Dockerfiles
  3. Right click > Build Image on the other Dockerfile
    1. Side note: it prompts for workspace folder here, which should be obvious given the selected Dockerfile
  4. It will find and execute the build task for the wrong Dockerfile (since the task matches against ${workspaceFolder}/Dockerfile, and even though it's in a different workspace folder, the ${workspaceFolder} token gets replaced with the chosen one from above

@bwateratmsft
Copy link
Collaborator

A fix for this has been released.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants