Babak Tourani
Babak Tourani

Reputation: 549

Is it possible to mount a volume on the host during BUILD phase of a docker image?

I'm using centos:6 and need to build an image -using Dockerfile- which has a number of rpms installed (Oracle client, in fact). I don't want to copy/add the rpms inside the image, as it will make the image bulky (and I have to remove the rpms after install, anyway).

Is there a way to mount a folder on the host (CentOS, itself) which contains the rpms, on the image, via Dockerfile and/or using any option of "docker build" command, during the BUILD phase?

Upvotes: 5

Views: 3864

Answers (1)

Horia Coman
Horia Coman

Reputation: 8781

There's no way, according to the docs for build and run as well as from my experience.

Mounting things is done when you're running a container, rather than when building an image.

Upvotes: 5

Related Questions