Giter Site home page Giter Site logo

Comments (5)

moufmouf avatar moufmouf commented on July 18, 2024 1

Hey @georgeboot ,

Ok, I found what is going on. Bitbucket overrides the "entrypoint" of the Docker image, but the thecodingmachine/php image is using this very same entrypoint to configure "php.ini" based on the environment variables.

See: https://community.atlassian.com/t5/Answers-Developer-Questions/Run-custom-entrypoint-command-in-Pipelines/qaq-p/516534

Maybe you could try to run the entrypoint manually?

Something like:

- step:
        script:
          - /usr/local/bin/docker-entrypoint.sh echo "entrypoint executed"

Could you let me know if this works?

from docker-images-php.

moufmouf avatar moufmouf commented on July 18, 2024

Hey @georgeboot ,

I think bitbucket only injects the user configured env variables after it has booted the container.

That would be surprising to me (but I have never used Bitbucket).

Let's first try to rule out a problem on the Docker image. Could you let me know what version (what tag) of the image you are using?

from docker-images-php.

georgeboot avatar georgeboot commented on July 18, 2024

That would be surprising to me (but I have never used Bitbucket).

Yes I agree, but that's the only reason that makes sense to me.

I've already tried running the image locally, and I can confirm that the image is fine.

The output of docker run -it --rm -e "PHP_EXTENSIONS=gd imagick intl" --name my-running-script thecodingmachine/php:7.2-v2-cli php -m includes gd, imagick and intl.

Same for docker run -it --rm -e "PHP_EXTENSION_INTL=1" --name my-running-script thecodingmachine/php:7.2-v2-cli php -m.

from docker-images-php.

georgeboot avatar georgeboot commented on July 18, 2024

@moufmouf I can confirm that this workaround actually works.

Output from a pipeline with PHP_EXTENSIONS=gd imagick intl pcntl

php -m
[PHP Modules]
apcu
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
imagick
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
SimpleXML
soap
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache

from docker-images-php.

sdespont avatar sdespont commented on July 18, 2024

@georgeboot I am trying to enable some extensions in BitBucket pipeline like you did. But the extensions are not enabled even with the entry point script execution. Could you help me figure it out ?

image:
  name: thecodingmachine/php:8.1-v4-fpm
  environment:
    PHP_EXTENSION_GD: 1
    PHP_EXTENSION_TIDY: 1
    PHP_EXTENSION_BCMATH: 1
    PHP_EXTENSION_IMAP: 1
    PHP_EXTENSION_INTL: 1
        
pipelines:
  default:
    - step:
        name: PHPCS and PHPStan
        size: 1x
        script:
          - /usr/local/bin/docker-entrypoint.sh echo "entrypoint executed"

from docker-images-php.

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.