0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Laradockのdocker-compose upがコケる

Posted at

環境

  • macOS Catalina 10.15.7
  • Docker for mac 2.4.0.0

現象

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

略

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

解決方法

https://github.com/Laradock/laradock.gitからクローンしたenv-example内に記載のphpのバージョンは7.3。
これをそのままコピーして.envを作成したのでphpのバージョンが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

phpのバージョンを7.4にするとうまくいくよ!とのことなので.envファイルを書き換える。

.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

7.4に変更後、再度docker-compose upを実行

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

略

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

うまくいったようです。

Mission Complete

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?