-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Closed
Labels
area/builderBuildBuildarea/volumesVolumesVolumeskind/enhancementEnhancements are not bugs or new features but can improve usability or performance.Enhancements are not bugs or new features but can improve usability or performance.
Description
In #1124, there was an explicit decision to not allow host-mounted volumes via the VOLUME command. However, I think I have a good use case for supporting host-mounts via VOLUME. Gentoo stores it's package repository under /usr/portage. I'm trying to set up a workflow like:
$ cat Dockerfile
FROM gentoo
VOLUME ["/usr/portage:/usr/portage:ro", "/usr/portage/distfiles:/usr/portage/distfiles:rw"]
RUN emerge sys-process/vixie-cron app-admin/syslog-ng app-admin/logrotate
RUN rc-update add syslog-ng default
RUN rc-update add vixie-cron default
$ docker import - gentoo < stage3-amd64-20131205.tar.bz2
$ docker build -t gentoo-syslog .
However, VOLUME doesn't support that, and docker build … doesn't support the -v tag. The end goal is to get a production image that doesn't include /usr/portage, since the package repository just bloats the production container. I can think of a few workarounds including NFS-mounting /usr/portage during the build or using:
$ docker run -v /usr/portage:/usr/portage:ro -v /usr/portage/distfiles:/usr/portage/distfiles:rw gentoo emerge …
$ docker commit …
for each of the build steps, but native Dockerfile support would be nice.
Conchylicultor, binarytemple-external, javier-lopez, dcharbonnier, bra-fsn and 1 more
Metadata
Metadata
Assignees
Labels
area/builderBuildBuildarea/volumesVolumesVolumeskind/enhancementEnhancements are not bugs or new features but can improve usability or performance.Enhancements are not bugs or new features but can improve usability or performance.