Docker image built using Dockerfile fails to build

Has any of you managed to build 26.0.2 out of the Dockerfile? The original Dockerfile with zero modifications fails to build for me:

Step 11/14 : COPY *.sh upgrade.exclude /

COPY failed: file not found in build context or excluded by .dockerignore: stat upgrade.exclude: file does not exist

I am using Portainer to build the image.

Ok, I should change my question as I just figured out what’s wrong. I’m missing the files next to the Dockerfile when just pasting the Dockerfile to Portainer and hitting build.
So the right question would be “How to build the image from the supplied Dockerfile using Portainer”. Manual build with the additional files in the same path works.

From the looks of it Portainer has a fairly limited image build environment. It doesn’t support COPY, for example.

You’d have to heavily modify many (most IMO) 3rd party Dockerfiles.

Fortunately Portainer just wraps around Docker so I see no reason you can’t build the image outside of it then switch back to Portainer to do what you want with it.

That’s what I understand. Don’t get why they made it so though.
You have the possibility to “add files” next to your Dockerfile and I tried giving it all the files needed, but still, didn’t manage to build the image so I went manual and did it using Docker directly.
Works as a charm. Too bad build with additional files is not easy with Portainer, while creating a whole Stack is so easy using just a docker-compose.yml, etc.
Thanks for the response!

Actually, just found out that COPY is supported in Portainer just not fully or in a weird way. Here’s an example: