Laradock docker-compose up is moss

environment

phenomenon

$ git clone https://github.com/Laradock/laradock.git
$ cd laradock
$ docker-compose up -d php-fpm nginx mysql phpmyadmin workspace

Abbreviation

Step 123/291 : RUN if [ ${INSTALL_AST} = true ]; then     if [ $(php -r "echo PHP_MAJOR_VERSION;") != "5" ]; then         printf "\n" | pecl -q install ast-${AST_VERSION} &&         echo "extension=ast.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/ast.ini &&         phpenmod -v ${LARADOCK_PHP_VERSION} -s cli ast     ;fi ;fi
 ---> Running in f765b424fea4
ERROR: `phpize' failed
ERROR: Service 'workspace' failed to build : The command '/bin/sh -c if [ ${INSTALL_AST} = true ]; then     if [ $(php -r "echo PHP_MAJOR_VERSION;") != "5" ]; then         printf "\n" | pecl -q install ast-${AST_VERSION} &&         echo "extension=ast.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/ast.ini &&         phpenmod -v ${LARADOCK_PHP_VERSION} -s cli ast     ;fi ;fi' returned a non-zero code: 1

Solutions

https://github.com/laradock/laradock/issues/2738#issuecomment-706938037

The version of php described in ʻenv-example cloned from https://github.com/Laradock/laradock.gitis 7.3. I copied this as it was and created.env`, so the php version was 7.3.

### PHP Version ###########################################

# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM).
# Accepted values: 7.4 - 7.3 - 7.2 - 7.1 - 7.0 - 5.6
PHP_VERSION=7.3

Setting the php version to 7.4 works fine! So rewrite the .env file.

.env


# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM).
# Accepted values: 7.4 - 7.3 - 7.2 - 7.1 - 7.0 - 5.6
PHP_VERSION=7.4

After changing to 7.4, run docker-compose up again

$ docker-compose up -d php-fpm nginx mysql phpmyadmin workspace

Abbreviation

Successfully built 8d1580fef486
Successfully tagged laradock_nginx:latest
WARNING: Image for service nginx was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating laradock_docker-in-docker_1 ... done
Creating laradock_mysql_1            ... done
Creating laradock_workspace_1        ... done
Creating laradock_phpmyadmin_1       ... done
Creating laradock_php-fpm_1          ... done
Creating laradock_nginx_1            ... done

It seems to have worked.

Mission Complete

Recommended Posts

Laradock docker-compose up is moss
What is `docker-compose up`?
What is Docker-compose? (Personal memorandum)
[Rails] How to speed up docker-compose
I want to docker-compose up Next.js!