Hi there!
Some time ago, our project was migrated from Gitlab to Bitbucket. On Gitlab, we had a pipeline to build an app inside a Docker container and push it to Gitlab, and then deploy it to ECS.
I'm using docker service and the same script in Bitbucket pipelines (except for pushing to AWS ECR), but the final image seems to be different from the one built in Gitlab or locally. Consequently, it fails to start correctly after deployment.
Something seems to be going wrong with the AWS SDK and getcomposer installation.
Here's the relevant section of the dockerfile:
RUN apt-get update \
&& apt-get install --assume-yes -y git zip unzip \
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& unzip awscliv2.zip \
&& ./aws/install \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer require aws/aws-sdk-php \
&& rm -rf /var/lib/apt/lists/* /awscliv2.zip /aws /tmp/* /var/tmp/* /root/.composer
The command composer require aws/aws-sdk-php should create the essential vendor directory inside the working directory. I can see this directory when I build the image locally. However, the final image built using Bitbucket pipelines doesn't seem to have this directory, and I can't figure out why.
The only way to fix the app after deployment is to run this command again via SSH.
Could you please advice me with this issue?