備忘録。
エラーのトラブルシューティングを並べました。
これをやりました。
https://www.ogis-ri.co.jp/otc/hiroba/technical/docker/part1.html
- ERROR: failed to solve: process "/bin/sh -c apk add --update py2-pip" did not complete successfully: exit code: 1
1.現行のpythonはversion3なので、dockerfileを以下に変更する# our base image FROM alpine:3.5 # Install python and pip RUN apk add --update py3-pip # upgrade pip RUN pip install --upgrade pip # install Python modules needed by the Python app COPY requirements.txt /usr/src/app/ RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt # copy files required for the app to run COPY app.py /usr/src/app/ COPY templates/index.html /usr/src/app/templates/ # tell the port number the container should expose EXPOSE 5000 # run the application CMD ["python", "/usr/src/app/app.py"]
- ERROR: failed to solve: alpine:3.5: no match for platform in manifest sha256:66952b313e51c3bd1987d7c4ddf5dba9bc0fb6e524eed2448fa660246b3e76ec: not found
- バージョン互換が切れてるっぽいのでバージョンをlatestに変更する
# our base image FROM alpine:latest # Install python and pip RUN apk add --update py3-pip # upgrade pip RUN pip install --upgrade pip # install Python modules needed by the Python app COPY requirements.txt /usr/src/app/ RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt # copy files required for the app to run COPY app.py /usr/src/app/ COPY templates/index.html /usr/src/app/templates/ # tell the port number the container should expose EXPOSE 5000 # run the application CMD ["python", "/usr/src/app/app.py"]
これで正常に動いてるっぽい。