Comments (3)
Thx for the ping - IMHO that's a two sided sword, but would make for better layer caching.
My thoughts are the following:
PRO (keep the vednor dir from the build host):
- caching. A warmed vendor directory is nice for build times
CONTRA ():
- users could have libraries in the vendor directory that do not belong to the current platform in cases the outer environment isnt congruent to the inner environment (the container one). That would cache garbage that would be frozen in the layer through the
COPY
directive - what about manually changed files in the vendor directory? Composer checks the integrity on install, but afaik only if the vendor directory is empty or nonexistent
My proposal is actually something in the middle:
ONBUILD COPY
composer.json and composer.lock (https://github.com/heroku/docker-php/blob/master/Dockerfile#L71) then composer install --no-scripts
to populate the global composer cache in the image. That way, there's a nice caching layer in place until either one of those files change. Now we can keep removing the vendor directory as the packages will be resolved through the global cache.
from php-docker.
Re: platform deps
We're running composer install
and it should fix it.
Re: manually changed files in the vendor directory?
It's kind of intentional to keep them.
Anyways, your proposal looks good too. I'll try them.
from php-docker.
I'm trying to implement it, but I get a feeling that it will require composer based app because
ONBUILD COPY composer.lock composer.json ${APP_DIR}
This line will fail if there are no such files.
I also want to support apps without composer.json (like WordPress!). What do you think?
from php-docker.
Related Issues (20)
- Cannot use nginx-app.conf with Drupal 8 docker image based off gcr.io/google-appengine/php:latest HOT 1
- Laravel 7 support (PHP 7.2.5)
- Setup Travis CI & GCP project on fork HOT 14
- Sunsetting 7.2 and older HOT 2
- Flex not building PHP 5.6 HOT 2
- Phalcon for PHP 7.3 HOT 2
- Base image not reading php version from composer.json
- Typo in Dockerfile -- "RUNTIME_DISTRUBTION"
- Support for PHP 7.4 and 8.0 HOT 18
- Redis version v3 -> v5 HOT 1
- Laravel 8 - build failed in google app engine flexible environment HOT 2
- Is there a way to extend Dockerfile.twig?
- ext-sodium PHP7.4 HOT 1
- Update to composer 2
- Is this the same as gcr.io/google-appengine/php? HOT 6
- Available PHP Versions are EOL HOT 9
- Something wrong with current latest HOT 3
- [SECURITY] current php73 image has some vulnerabilities HOT 2
- multi-arch support
- PHP 8.1 update HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-docker.