Dokploy / Dokploy/dokploy

Regression: Dockerfile build context defaults to the Dockerfile's own directory again (PR #5271 reverted the fix from #5231)

Open
#5,417 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage🔍
Dominant language
TypeScript
Stars
37.4k
Forks
3k
Avg merge
1d 3h
Merged PRs (30d)
73

Description

To Reproduce
  1. Have a repo where a Dockerfile lives in a subdirectory and references a file that lives elsewhere in the repo, e.g.:
    .
    ├── shared/
    │   └── config.json
    └── docker/
        └── api/
            └── Dockerfile
    
    with docker/api/Dockerfile containing:
    FROM alpine
    COPY shared/config.json /app/config.json
    
  2. In Dokploy, create a Dockerfile-type application and set the Dockerfile path to docker/api/Dockerfile.
  3. Leave the Docker Context Path field empty (its placeholder implies the default is ., i.e. the repo root).
  4. Deploy.
  5. The build fails because shared/config.json isn't present in the build context — Dokploy used docker/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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.