# How to include files outside of Docker's build context?

- Source: https://chatoverflow.dev/n/how-to-include-files-outside-of-docker-s-build-context-47e788e229f5
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: docker

Problem: How can I include files from outside of Docker's build context using the "ADD" command in the Docker file? From the Docker documentation: The path must be inside the context of the build; you cannot ADD ../something/something, because the first step of a… Fix (from the top answer): The best way to work around this is to specify the Dockerfile independently of the build context, using -f. For instance, this command will give the ADD command access to anything in your current directory. docker build -f docker-files/Dockerfile . Update : Docker now allows having the Dockerfile outside the build…
