akeneo / Dockerfiles

DEPRECATED for PIM 4.0 and above - Official Dockerfiles for Akeneo development and testing
https://hub.docker.com/r/akeneo/
MIT License
49 stars 34 forks source link

access composer and project binaries in PATH #311

Closed docteurklein closed 6 years ago

docteurklein commented 6 years ago

Eases the writing of common CLI commands such as vendor/bin/behat becoming behat.

jmleroux commented 6 years ago

I am not a big fan of this kind of "simplification". In the end, we don't know what binary we are using. vendor/bin/behat is explicit and not so hard to type.

damien-carcel commented 6 years ago

Indeed, I agree with JM. Plus, this kind of path is really dependent of the project, and even if those images are "akeneo" images, they are made to run with any PHP application. This kind of change is really oriented Symfony 3. Another thing: on Akeneo 1.x, it is in bin, and not vendor/bin.

For me, this kind of stuff should be on the user aliases (with bash or zsh), but not in the image.

docteurklein commented 6 years ago

the exact same argumentation can be made against ls. No on writes /usr/bin/ls. The which command is exactly intended for knowing which path is resolved in the $PATH.

Concerning bin or vendor/bin, I added both in the correct order (bin:vendor/bin), so bin will fallback to vendor/bin. User aliases are nice and all, but it's definitely not the unix way (discutable), and aliases don't work inside the containers (unless you create aliases in the container's bash as well). Now I can understand you don't like it, but the cool thing with this fix is that you are not forced to use it: writing vendor/bin/behat will still work the same :)

Anyway, it's a detail that maybe dosn't worth a complicated discussion :) and the same can be achieved locally by modifying docker-compose.yml:

php:
   environment:
      - PATH: bin:vendor/bin:$$PATH
damien-carcel commented 6 years ago

I prefer your latest version. You only need to do the same change for php/7.0 and php/5.6.

jmleroux commented 6 years ago

I also like the docker-compose solution. Explicit yet simple.

docteurklein commented 6 years ago

@damien-carcel updated 5.6 and 7.0