1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

さわって理解するDocker入門 failed to solve: process

Posted at

備忘録。
エラーのトラブルシューティングを並べました。

これをやりました。
https://www.ogis-ri.co.jp/otc/hiroba/technical/docker/part1.html

  1. 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"]
    
    
  2. ERROR: failed to solve: alpine:3.5: no match for platform in manifest sha256:66952b313e51c3bd1987d7c4ddf5dba9bc0fb6e524eed2448fa660246b3e76ec: not found
    1. バージョン互換が切れてるっぽいのでバージョンを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"]
    
    

これで正常に動いてるっぽい。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?