Get composer (php dependency manager) to run on a docker image build

后端 未结 2 2005
醉话见心
醉话见心 2020-12-14 06:05

NOTE: I no longer use this environment so there is no way for me to test the answers and accept one. I\'m sorry.

TL;DR

2条回答
  •  独厮守ぢ
    2020-12-14 06:45

    Installing composer like this will avoid this problem:

    RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
    && curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
    # Make sure we're installing what we think we're installing!
    && php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" \
    && php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --snapshot \
    && rm -f /tmp/composer-setup.*
    

提交回复
热议问题