Regression: Dockerfile build context defaults to the Dockerfile's own directory again (PR #5271 reverted the fix from #5231)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 37.4k
- Forks
- 3k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 73
Description
To Reproduce
- Have a repo where a
Dockerfilelives in a subdirectory and references a file that lives elsewhere in the repo, e.g.:
with. ├── shared/ │ └── config.json └── docker/ └── api/ └── Dockerfiledocker/api/Dockerfilecontaining:FROM alpine COPY shared/config.json /app/config.json - In Dokploy, create a
Dockerfile-type application and set the Dockerfile path todocker/api/Dockerfile. - Leave the
Docker Context Pathfield empty (its placeholder implies the default is., i.e. the repo root). - Deploy.
- The build fails because
shared/config.jsonisn't present in the build context — Dokploy useddocker/api/as the context instead of the repo root:#5 [2/2] COPY shared/config.json /app/config.json #5 ERROR: failed to calculate checksum of ref ...: "/shared/config.json": not found
For comparison, an equivalent Compose-type app with compose.yaml declaring context: . and dockerfile: docker/api/Dockerfile builds the same Dockerfile correctly, since it actually uses the repo root as context.
Current vs. Expected behavior
Expected: with Docker Context Path left empty, the build context defaults to the application's code root ., matching the field's own placeholder and matching how docker compose build resolves the same Dockerfile.
Actual: the build context defaults to the Dockerfile's own directory instead, so any file reference outside that directory 404s during the build.
Provide environment information
Operating System:
OS: Ubuntu (self-hosted VPS)
Arch: amd64
Dokploy version: 0.30.6
VPS Provider: (self-hosted / on-prem)
What applications/services are you trying to deploy?
Dockerfile-type applications in a monorepo, where the Dockerfile lives in a
subdirectory (e.g. docker/<service>/Dockerfile) and COPYs files from the repo
root, matching the context: . setting used by the equivalent compose.yaml.
Which area(s) are affected? (Select all that apply)
Docker, Application
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
No response
Will you send a PR to fix it?
Maybe, need help
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing Dockerfile-type application context resolution with the compose.yaml behavior described in the issue, focusing on how an empty Docker Context Path is interpreted when the Dockerfile is in a subdirectory. Reproduce the example with docker/api/Dockerfile and shared/config.json, then verify that the build uses the repository root as context and completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100