diff --git a/docker-compose.yml b/docker-compose.yml index 45791f82..9652f941 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -110,6 +110,7 @@ services: - INSTALL_OCI8=${WORKSPACE_INSTALL_OCI8} - INSTALL_V8JS=${WORKSPACE_INSTALL_V8JS} - COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL} + - COMPOSER_VERSION=${WORKSPACE_COMPOSER_VERSION} - COMPOSER_AUTH=${WORKSPACE_COMPOSER_AUTH} - COMPOSER_REPO_PACKAGIST=${WORKSPACE_COMPOSER_REPO_PACKAGIST} - INSTALL_WORKSPACE_SSH=${WORKSPACE_INSTALL_WORKSPACE_SSH} diff --git a/env-example b/env-example index 0585bfda..95911015 100644 --- a/env-example +++ b/env-example @@ -100,6 +100,7 @@ SHELL_OH_MY_ZSH_ALIASES=false WORKSPACE_BASE_IMAGE_TAG_PREFIX=latest WORKSPACE_COMPOSER_GLOBAL_INSTALL=true +WORKSPACE_COMPOSER_VERSION=2 WORKSPACE_COMPOSER_AUTH=false WORKSPACE_COMPOSER_REPO_PACKAGIST= WORKSPACE_NVM_NODEJS_ORG_MIRROR= diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 43e76871..e6bd977f 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -147,6 +147,11 @@ RUN chown -R laradock:laradock /home/laradock/.composer RUN echo "" >> ~/.bashrc && \ echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> ~/.bashrc +# Update composer +ARG COMPOSER_VERSION=2 +ENV COMPOSER_VERSION ${COMPOSER_VERSION} +RUN composer self-update --${COMPOSER_VERSION} + USER laradock # Check if global install need to be ran