mercari-build / mercari-build-training

24 stars 225 forks source link

Step5 #180

Closed Ayana326 closed 8 months ago

Ayana326 commented 8 months ago

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 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 SIZE wakanapo/tesseract-ocr latest b13469b4999f 21 months ago 167MB

alpineという名前の image を取得し、確認する

command docker pull alpine docker images answer REPOSITORY 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 answer REPOSITORY 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 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

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.

momom-i commented 8 months ago

@Ayana326 You have to open Pull Request on your own forked repository. 🙏 Close this PR.