docker buildx build --build-context app=../app -t myapp .

Category: Docker

docker buildx build --build-context app=../app -t myapp .

Build with an extra named context

build-context binds a name to a local directory, image, or git URL that the Dockerfile references by name, for example COPY --from=app. Keeps sibling sources out of the main build context, which speeds up uploads. Without it, only the build directory reaches the builder.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.