2

Hopefully someone can help me see the wood for the trees as they say!

I am no Linux expert and therefore I am probably missing something very obvious. I have a dockerfile which contains the following:

FROM node:9.8.0-alpine as node-webapi
EXPOSE 3000
LABEL authors="David Sheardown"
COPY ["package.json", "npm-shrinkwrap.json*", "./"]
RUN npm install --production --silent && mv node_modules ../
COPY . /home/vsts/work/1/s/
CMD ["node", "index.js"]

I then have an Azure pipeline setup as the following image shows:

enter image description here

My issue seems to be the build process cannot find the dockerfile itself:

##[error]Unhandled: No Dockerfile matching  /home/vsts/work/1/s/**/Dockerfile  was found.

Again, apologies in advance for my lack of Linux knowledge.. there is something silly I have done or not done ;)

P.S: I forgot to mention in Azure Pipelines I am using "Hosted Linux Preview"

-- UPDATE --

This is the get sources stage:

enter image description here

5
  • Can you share you "Get Sources" stage? Commented Oct 15, 2018 at 7:53
  • Hi @ShaykiAbramczyk sorry about the delay, I have been chasing around a lot. I have a screenshot of the "Get Sources" stage, but I think I have to add to the question (see UPDATE) as I cannot seem to add an image here.. many thanks for helping! Commented Nov 3, 2018 at 7:10
  • I need the logs of the Get Sources stage, can you share it also? Commented Nov 3, 2018 at 16:13
  • Hi @ShaykiAbramczyk my apologies, I have included the logs (azure pipelines gave me the option to download as zip) Here is the link to the zip: 1drv.ms/f/s!AokoVeppvI53iLFdju-mJAVDCk41og Many thanks for your help! Commented Nov 8, 2018 at 10:08
  • Hi, I don't know why but I can't see in the logs which files downloaded in the "Get Sources", can you just take a screenshot like this: imgur.com/a/RialbDr Commented Nov 8, 2018 at 10:32

2 Answers 2

0

I would recommend adding the exact path to where the docker file resides on your repository .

 Dockerfile: subpath/Dockerfile`
Sign up to request clarification or add additional context in comments.

Comments

0

You're misusing this absolute path, both within the dockerfile and in the docker build task:

/home/vsts/work/1/s/

That is a path that exists on the build agent (not within the dockerfile) - but it may or may not exist on any given pipeline run. If the agent happens to use work directory 2, or 3, or any other number, then your path will be invalid. If you want to run this pipeline on a different type of agent, then your path will be invalid.

If you want to use a dockerfile in your checked out code, then you should do so by using a relative path (based on the root of your code repository), for example:

buildinfo/docker/Dockerfile

Note: that was just an example, to show the kind of path you should use; here you should be using the actual relative path in your actual code repo.

1 Comment

PS for related but different reasons, the "COPY . /home/vsts/work/1/s/" line in your dockerfile needs to be done differently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.