前提
お世話になります。
以下事象で困っており対処方法、試すべき事、
ヒントをアドバイス戴けますと幸いです。
当方環境
Win11上でWSL2/Docker desktop for Win/Ubuntu_latest
Ubuntuベースイメージからカスタムしたコンテナ内に
Python-Anaconda開発環境作ってコーディング中
実現したいこと
Selenium利用したChromeの自動操作したいため、
コンテナ内にChromeLinux版+そのverに対応する
Chromeドライバーを導入したい。
その為に、Dockerfileを追記更新、
Imageから再Buildしコンテナ再作成したい。
発生している問題・エラーメッセージ
以下dockerfileとdockerコマンド実行し、
image作成できた。docker imagesでimage確認できた。
また、停止状態のコンテナの存在まで確認できた。
その後、docker-compose up -d やdocker start やdocker runなど起動を色々試したが
停止中のコンテナから起動ができないエラー
更新して実行したdockerfile
FROM ubuntu:latest WORKDIR /tmp ENV TZ=Asia/Tokyo RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && apt-get install -y sudo wget vim curl gawk make gcc git portaudio19-dev unzip RUN wget https://repo.continuum.io/archive/Anaconda3-2022.05-Linux-x86_64.sh && \ bash Anaconda3-2022.05-Linux-x86_64.sh -b && \ rm -f Anaconda3-2022.05-Linux-x86_64.sh && \ sudo curl -sL https://deb.nodesource.com/setup_lts.x | sudo bash - && \ sudo apt-get install -y nodejs ENV PATH $PATH:/root/anaconda3/bin RUN pip install --upgrade pip RUN pip install pandas_datareader RUN pip install mplfinance RUN pip install japanize-matplotlib RUN pip install selenium RUN pip install webdriver_manager RUN pip install tweepy RUN pip install spotipy RUN pip install --upgrade google-cloud-speech RUN pip install pydub RUN pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio RUN pip install Scrapy RUN wget --quiet http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz -O ta-lib-0.4.0-src.tar.gz && \ tar xvf ta-lib-0.4.0-src.tar.gz && \ cd ta-lib/ && \ ./configure --prefix=/usr && \ make && \ sudo make install && \ cd .. && \ pip install TA-Lib && \ rm -R ta-lib ta-lib-0.4.0-src.tar.gz RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add && \ wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_103.0.5060.134-1_amd64.deb && \ apt-get install -y -f ./google-chrome-stable_103.0.5060.134-1_amd64.deb ADD https://chromedriver.storage.googleapis.com/103.0.5060.134/chromedriver_linux64.zip /opt/chrome/ RUN cd /opt/chrome/ && \ unzip chromedriver_linux64.zip ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/chrome RUN mkdir /workspace CMD ["jupyter-lab", "--notebook-dir=/workspace","--ip=0.0.0.0","--port=8888" ,"--no-browser", "--allow-root", "--LabApp.token=''"] WORKDIR /
実行したDockerコマンド
docker build . --no-cache docker ps -a
その後、docker-compose up -d やdocker start やdocker runなど起動を色々試した
実行結果のエラー
ERROR: for docker-python Cannot start service jupyterlab: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "jupyter-lab": executable file not found in $PATH: unknown ERROR: for jupyterlab Cannot start service jupyterlab: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "jupyter-lab": executable file not found in $PATH: unknown ERROR: Encountered errors while bringing up the project.
試したこと
jupyter-labの実行ファイルがないとのメッセージで
今回追記した部分を削除し元のdockerfileに戻して
imageから再Buildすると普通にコンテナ作成されjupyterlabも起動し使える。
jupyterlabの実行ファイル自体が存在しない訳ではなく、
PATHが変わっておかしくなっているのでは??という想像
元のdockerfileに対して追記した差分は以下のみ
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add && \ wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_103.0.5060.134-1_amd64.deb && \ apt-get install -y -f ./google-chrome-stable_103.0.5060.134-1_amd64.deb ADD https://chromedriver.storage.googleapis.com/103.0.5060.134/chromedriver_linux64.zip /opt/chrome/ RUN cd /opt/chrome/ && \ unzip chromedriver_linux64.zip ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/chrome
これまで調査した事
以下サイトなどでエラーコードから原因調査しているが初学者で
どうしても対処策が掴めない状況
https://qol-kk.com/wp2/blog/2021/07/06/post-2951/
https://qiita.com/miyabi-san/items/dab69ebbbd3fb4d98875
https://genchan.net/it/virtualization/docker/3013/
https://github.com/docker/for-linux/issues/1371
https://demura.net/misc/22079.html
https://forums.docker.com/t/error-response-from-daemon-oci-runtime-create-failed-container-linux-go-starting-container-process-caused-exec-python/115382
https://suzuyosy.com/index.php/2022/06/22/post-1006/
https://cpoint-lab.co.jp/article/202203/22324/
https://forums.docker.com/t/error-response-from-daemon-oci-runtime-create-failed-container-linux-go-starting-container-process-caused-exec-python/115382
https://stackoverflow.com/questions/71966074/executble-file-not-found-in-path-unknown
https://stackoverflow.com/questions/27158840/docker-executable-file-not-found-in-path
https://developer.aliyun.com/article/912988
https://teratail.com/questions/e5eui7nqvayr1h

回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。
2022/08/08 15:35