###経緯
dockerfileにて下記のシェルをコピー、実行をしたいと考えています。
シェルではexpectを用いてインタラクティブな動作の回避をしています。
COPY ./magento_install.sh / RUN sudo /bin/bash /magento_install.sh
シェルスクリプトは下記になります。
1 #! /bin/sh 2 3 ID="hogehoge" 4 PW="hogegoge" 5 YES=Y 6 7 expect -c " 8 set timeout 60 9 spawn env LANG=C sudo /usr/local/bin/composer.phar create-project --repository=https://repo.magento.com/ magento/project-community-edition=2.2.5 /var/www/html/ 10 expect \"Username:\" 11 send \"${ID}\n\" 12 expect \"Password:\" 13 send \"${PW}\n\" 14 expect \"Do you want to store credentials\" 15 send \"${YES}\n\" 16 expect \"$\" 17 exit 0 18 "
###問題
実行すると下記のように「Removing intermediate container 」と表示され実際にインストール作業が行られません。
何度かビルドしていますが、最初はインストール作業が行われていました。
Step 28/37 : RUN sudo /bin/bash /magento_install_2.sh ---> Running in 08e7fc8a4e62 spawn env LANG=C sudo /usr/local/bin/composer.phar create-project --repository=https://repo.magento.com/ magento/project-community-edition=2.2.5 /var/www/html/ Removing intermediate container 08e7fc8a4e62 ---> ac8813a77265
###試した事
イメージとコンテナを全て削除し、ビルド時はオプションno-cacheを指定しています。
docker rm $(docker ps -aq) docker rmi $(sudo docker images -q)
###質問
なぜシェル内のスクリプトは実行されないのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。