The Dockerfile can not be outside the build context. Every file in the context path will be copied into the build context. COPY will only be able to copy files from the build context into the image.
You either need to put the Dockerfile called dockerfile (the default name is Dockerfile and not dockerfile) into /home/docker/test, or use `/home/docker/ as context, and make sure to align the paths inside the Dockerfile as well.
âdoesnât workâ is rarely helpful for others that are not sitting in front of your screen. Please start sharing exact error messages (as in copy/paste them), so we donât have to guess what exactly doesnât work.
On another note: an api client must be able to access the files/folders, to pass the client side verification. I assume you did not bind the host path /home/docker into the Portainer containerâs path /home/docker.
I never understood why people use Portainer for anything else that execing into containers, and checking logs⊠It just adds another layer of complexity that leads to confusion, if not properly understood. Functional issues caused by using Portainer, are best discussed in a Portainer related forum amongst peers that use Portainer as well.
docker build -t test -f /home/docker/test/Dockerfile .
Builds it fine
Portainer doenst work with a Docker compose âStackâ Here i get the Error:
Failed to interpolate config for stack test. Error: compose config operation failed: failed to load the compose file: validating /data/compose/32/v4/docker-compose.yml: services.test.build Additional property Dockerfile is not allowed
If it was copy-pasted, one thing I notice is that the message mentions âDockerfileâ with an uppercase first letter, which should be lowercase as it was in your compose file in your first post.
By the way you can also try the alternative property, dockerfile_inline
So you donât need an external Dockerfile and you can keep everything in the compose file.
Quote from the docs:
services:
base:
build:
context: .
dockerfile_inline: |
FROM alpine
RUN ...
my-service:
build:
context: .
dockerfile_inline: |
FROM base # image built for service base
RUN ...
additional_contexts:
base: service:base