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

Docker push requires Dockerfile #10148

Closed
iorlas opened this issue Apr 17, 2019 · 4 comments
Closed

Docker push requires Dockerfile #10148

iorlas opened this issue Apr 17, 2019 · 4 comments

Comments

@iorlas
Copy link

iorlas commented Apr 17, 2019

Required Information

Question, Bug, or Feature?
Type: Bug

Enter Task Name: Docker

Issue Description

  1. DockerV2 task push command implementation relies on Dockerfile existence
  2. Although Dockerfile input is used, it is not available in Designer for push command since visibility is: command = build || command = buildAndPush

Which leads to inability to use push command at all, forcing to use V1 or buildAndPush instead.

Task logs

Unhandled: No Dockerfile matching /home/vsts/work/r1/a//Dockerfile was found.
Unhandled: No Dockerfile matching /home/vsts/work/r1/a/
/Dockerfile was found.

Suggestion

Docker push should not rely on Dockerfile at all. That's a must.

But task needs to publish deployment metadata to the TeamFoundationCollection URL, it wants to know the base image name. It is not possible to get base image name from the docker image itself.

Also, it is kind of bad design to rely on one base image, since many and many projects use multi-stage builds, hence multiple base images sequentially. But it could be a different topic.

Option 1: Use LABEL (my preference)

Instead of getting base image on the push command, it is wise to retrieve it where we build such container. So, I would keep current logic, but use BUILD task for it instead, adding LABEL with base image information.

Then, in PUSH, I would get base image name using docket image inspect command. No label? Use "unknown" placeholder. Easy-peasy.

Option 2: Provide access to the Dockerfile configuration

So our artifacts should contain Dockerfile and we should be able to provide its path in push command, solved by updating visibility command. But still, leaves Dockerfile requirement and forces to create artifact for it.

Option 3: Remove push command

Since it is now useful in any kind of way right now

@bansalaseem
Copy link
Contributor

@ajinkya599 we should fix this.

@SebAubin
Copy link

Is there anything I can do if I want to push an image in our repository?

@bansalaseem
Copy link
Contributor

@SebAubin, You can either use buildAndPush command or use docker v1 task till push command is fixed. @ajinkya599 should be able to fix the push command early next week in docker v2.

@SebAubin
Copy link

Thanks you!

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

No branches or pull requests

4 participants