Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume-less flavours #180

Closed
kkurczewski opened this issue May 31, 2019 · 3 comments
Closed

Volume-less flavours #180

kkurczewski opened this issue May 31, 2019 · 3 comments
Labels
Request Request for image modification or feature

Comments

@kkurczewski
Copy link

Is this possible to add image flavour without hardcoded VOLUME?

I mean image tag would be: 3.11.4-no-volume instead 3.11.4 and will not have VOLUME clause. Old clients can use old convention and don't worry about persistence where others can choose how store that data if at all. I see one usage in tests where at this moment I need to remember to remove volumes.

Note this would be obsolete if moby/moby#18286 will be resolved (and applied in docker-compose).

Any thoughts?

@wglambert wglambert added the Request Request for image modification or feature label May 31, 2019
@wglambert
Copy link

Other discussions on removing inherent volumes in images docker-library/mongo#306, redis/docker-library-redis#140, docker-library/postgres#404, docker-library/mysql#255

@tianon
Copy link
Member

tianon commented May 31, 2019

While I agree it's unfortunate Docker doesn't have a feature to disable inherited volumes, I really hesitate to add extra explicit variants that then need to be maintained to support this.

I've been able to work around this and get Cassandra storing data outside the volume successfully with something similar to the following:

FROM cassandra:3
RUN sed -i 's!/var/lib/cassandra!/tmp/cass!g' /etc/cassandra/cassandra.yaml

(Where /tmp/cass gets replaced with whatever directory you want the final image to store data in.)

@kkurczewski
Copy link
Author

Yes, that kinda would work but I feel this is little hackish... I need afterall make my own image which will still have dangling empty volume.

Sorry if I'm sound annoying but still I'm not convinced to your standpoint.

Now let me summarize my arguments:

  • there is demand for such thing (as @wglambert pointed out)
  • I understand that implementing volumes-removal feature may be hard to implement & maintain so I don't touch this topic, (btw. I don't feel this is way to go)
  • my proposal is simple & backward-compability complaint

My proposed solution:
tag=...;` sed 's/VOLUME.*//1' ./Dockerfile | docker build -t "${tag}-volumeless" . -f -

And that's all. I believe adjusting travis.yml would be sufficient, correct me if I wrong.

Of course, I could keep those volume-less images by myself in my private/public repository, but:

  • I'm not trusted & highly secured party like docker is
  • managing such fork would be repetitive and delayed in time (think about security holes & other bugs)
  • declaration could look funny and/or less professional with my custom repository in name: kkurczewski/cassandra:3.1-volumeless

I mean, this is really simple thing to do useful at least for a bunch of people who care to comment about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

3 participants