Git Product home page Git Product logo

Comments (8)

janpapenbrock avatar janpapenbrock commented on July 29, 2024 1

Can confirm that it works as expected now.

from docker.

janpapenbrock avatar janpapenbrock commented on July 29, 2024

I don't get what is going on exactly, however some things to note:

  1. Output of composer gloabl require -vvv phpmetrics/phpmetrics is mostly identical, except for hashes.

  2. VOLUME /composer (here) vs VOLUME /app (here)

FROM composer:1.2.2

RUN composer global require 'phpmetrics/phpmetrics'
RUN stat /composer/vendor

CMD [""]
ENTRYPOINT ["phpmetrics"]

gives stat: can't stat '/composer/vendor': No such file or directory here, whereas the directory exists when using composer/composer:1.1

  1. Might be this from the Dockerfile reference section on VOLUME:

Note: If any build steps change the data within the volume after it has been declared, those changes will be discarded.

As the volume is declared in the base image and I extend it, my RUN command writes into the volume and the changes are discarded immediately.

  1. Conclusion: I think /composer should not be annotated as VOLUME in the base image at all, so users can change its contents when extending from this image. A different use-case when this was desirable could be ADDing composer.* and running composer install during docker build for caching purposes.

from docker.

alcohol avatar alcohol commented on July 29, 2024

Thank you for reporting this and taking the time to thoroughly investigate the issue.

I am honestly not sure as to what the common conventions are regarding declaring volumes in official base images.

Perhaps it would be best if we did not declare a volume at all.

Please give me the time to get some feedback from some more experienced Docker folks before taking any actions. I will try to get back to you with an answer/solution asap :-)

from docker.

janpapenbrock avatar janpapenbrock commented on July 29, 2024

Thanks for the quick response :) I saw that you explained your line of thought in the original pull request but did not receive feedback on that in particular.

So it's probably best to get some expert knowledge here, happy to wait!

from docker.

alcohol avatar alcohol commented on July 29, 2024

@yosifkit | alcohol: We usually only declare volumes for things like database storage.

I'll drop the VOLUME declaration.

from docker.

alcohol avatar alcohol commented on July 29, 2024

@janpapenbrock the VOLUME declaration has been dropped, but it can take a while before the change gets merged. Keep an eye out :-)

from docker.

janpapenbrock avatar janpapenbrock commented on July 29, 2024

Awesome, thank you!

from docker.

alcohol avatar alcohol commented on July 29, 2024

Good to hear :-)

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.