Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can I select the version of php in composer:2 image

joseph
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 13, 2022

In my project I want to deploy my Laravel application with composer and php v8.1.6, but the default of this container now is 8.2.0 as of Dec 12.

I'd like to know if its possible to choose a version of php in this image? I have seen solutions that require me to host my own docker container, but obviously if I can avoid this and just specify in my pipeline what version of php I want that would be preferred. 

I have also seen the solution to use the --ignore-platform-reqs flag, which works, but i do not want to rely on this solution.

For more context, my application will not deploy with v8.2 as i have dependencies that requires <8.2, and i have tried to use the php:8.1.6-cli image, but this means composer is not properly installed and the build fails.

This is my config, which fails at composer install step

pipelines:
branches:
master:
- step:
name: 'Build and Test production'
image: composer:2
caches:
- composer
script:
- apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
.....

 

1 answer

1 accepted

0 votes
Answer accepted
pshryock
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 14, 2022

Pin to composer:2.4.1

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events