command
docker run -v $(pwd)/data/text_en.png:/tmp/img.png wakanapo/tesseract-ocr tesseract /tmp/img.png stdout -l eng
answer
Welcome to Build@Mercari !! Enjoy training and let’s skill up :)
3. Docker Image を取得する
imagesを見る
command
docker images
answer
REPOSITORY TAG IMAGE ID CREATED SIZEwakanapo/tesseract-ocr latest b13469b4999f 21 months ago 167MB
alpineという名前の image を取得し、確認する
command
docker pull alpinedocker images
answer
REPOSITORY TAG IMAGE ID CREATED SIZEalpine latest 05455a08881e 3 weeks ago 7.38MBwakanapo/tesseract-ocr latest b13469b4999f 21 months ago 167MB
4. Docker Image を Build する
Dockerfileをbuildする
command
docker build -t build2024/app:latest .docker images
answer
REPOSITORY TAG IMAGE ID CREATED SIZEbuild2024/app latest 8048d5aebe69 7 minutes ago 7.38MBalpine latest 05455a08881e 3 weeks ago 7.38MBwakanapo/tesseract-ocr latest b13469b4999f 21 months ago 167MB
command
docker run build2024/app:latest
answer
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "python": executable file not found in $PATH: unknown. ERRO[0000] error waiting for container: context canceled
answer after fixing code
Python 3.8.17
What
2. Docker を触ってみる
画像から文字を読み取る
command
docker run -v $(pwd)/data/text_en.png:/tmp/img.png wakanapo/tesseract-ocr tesseract /tmp/img.png stdout -l eng
answerWelcome to Build@Mercari !! Enjoy training and let’s skill up :)
3. Docker Image を取得する
imagesを見る
command
docker images
answerREPOSITORY TAG IMAGE ID CREATED SIZE
wakanapo/tesseract-ocr latest b13469b4999f 21 months ago 167MB
alpineという名前の image を取得し、確認する
command
docker pull alpine
docker images
answerREPOSITORY TAG IMAGE ID CREATED SIZE
alpine latest 05455a08881e 3 weeks ago 7.38MB
wakanapo/tesseract-ocr latest b13469b4999f 21 months ago 167MB
4. Docker Image を Build する
Dockerfileをbuildする
command
docker build -t build2024/app:latest .
docker images
answerREPOSITORY TAG IMAGE ID CREATED SIZE
build2024/app latest 8048d5aebe69 7 minutes ago 7.38MB
alpine latest 05455a08881e 3 weeks ago 7.38MB
wakanapo/tesseract-ocr latest b13469b4999f 21 months ago 167MB
5. Dockerfile を 変更する
References
https://matsuand.github.io/docs.docker.jp.onthefly/language/python/build-images/#create-a-dockerfile-for-python
STEP5-4 で Build した Image を実行する
command
docker run build2024/app:latest
answerdocker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "python": executable file not found in $PATH: unknown. ERRO[0000] error waiting for container: context canceled
answer after fixing codePython 3.8.17
6. 出品 API を docker 上で動かす
References
https://qiita.com/Toyo_m/items/5713f85a9d5ff8d9cc0d
Tips
コンテナIDの表示
docker ps
コンテナの停止docker stop <コンテナID>
ログの表示docker logs <コンテナID>
CHECKS :warning:
Please make sure you are aware of the following.