Symfony2.8から3系のLTSにアップデートするためにまずは環境構築をと思い、
今までの開発環境からコンテナの開発環境に移行する時に起きた問題。
■今までの開発環境
CentOS6
PHP5.6.3
MySQL5.5
■今回試した開発環境
Docker
httpd:2.4.25-alpine
php:5.6-fpm-alpine
mysql:5.5
環境を構築してからソースをgit cloneして
設置していく際に以下のエラーが発生。
You have requested a non-existent service “*****************”.
サービスは読み込まれているか以下のコマンドで確認。
# ./app/console debug:container
/bin/grep: unrecognized option: fixed-strings
BusyBox v1.24.2 (2017-11-23 08:52:33 GMT) multi-call binary.
Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...
Search for PATTERN in FILEs (or stdin)
-H Add 'filename:' prefix
-h Do not add 'filename:' prefix
-n Add 'line_no:' prefix
-l Show only names of files that match
-L Show only names of files that don't match
-c Show only count of matching lines
-o Show only the matching part of line
-q Quiet. Return 0 if PATTERN is found, 1 otherwise
-v Select non-matching lines
-s Suppress open and read errors
-r Recurse
-i Ignore case
-w Match whole words only
-x Match whole lines only
-F PATTERN is a literal (not regexp)
-E PATTERN is an extended regexp
-m N Match up to N times per file
-A N Print N lines of trailing context
-B N Print N lines of leading context
-C N Same as '-A N -B N'
-e PTRN Pattern to match
-f FILE Read pattern from file
Symfony Container Public Services
=================================
・・・
いつもより少ないサービス一覧
・・・
するといつもより少ない。。
あと、以下の部分が気になる。
/bin/grep: unrecognized option: fixed-strings BusyBox v1.24.2 (2017-11-23 08:52:33 GMT) multi-call binary.
もしかしたらBusyBoxのgrepに何かあるんじゃないかということで、
JMS\DiExtraBundleの設定を変更してみる。
https://jmsyst.com/bundles/JMSDiExtraBundle/master/configuration
「disable_grep: true」を追加。
Symfony/app/config/config.yml
jms_di_extra:
locations:
all_bundles: false
bundles: [AppBundle]
directories: ["%kernel.root_dir%/../src"]
↓に変更
jms_di_extra:
locations:
all_bundles: false
bundles: [AppBundle]
directories: ["%kernel.root_dir%/../src"]
disable_grep: true
とりあえず動いた。