xcorat
xcorat

Reputation: 1472

Docker: How to link external folder while building dockerfile

I need to link an external folder, on the host, while building a docker image. I do not want to copy this folder due to its large size, and it is shared over the hosts that run the container.

What is the proper way to do this? I am planning to mount this folder when running the container.

Upvotes: 0

Views: 492

Answers (1)

Luiz Ferraz
Luiz Ferraz

Reputation: 1525

You can't do it with the default Docker build engine. But you can do it with Docker buildkit using the new syntax: https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md#build-mounts-run---mount

The instructions on how to enable buildkit is on the same page

Upvotes: 1

Related Questions