ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
Django==3.0.2 from https://files.pythonhosted.org/packages/55/d1/8ade70e65fa157e1903fe4078305ca53b6819ab212d9fbbe5755afc8ea2e/Django-3.0.2-py3-none-any.whl#sha256=4f2c913303be4f874015993420bf0bd8fd2097a9c88e6b49c6a92f9bdd3fb13a (from -r requirements.txt (line 1)):
Expected sha256 4f2c913303be4f874015993420bf0bd8fd2097a9c88e6b49c6a92f9bdd3fb13a
Got 6aba4ad691e29fadb6d5367e4c331bd4aee1d824fb4f005c3b8d3d9b055e8ad4
構成としてはプロジェクトのディレクトリ配下に以下のファイルを置いています。
Dokerfile
FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install pip==19.1.1 --no-cache-dir
RUN pip install -r requirements.txt --no-cache-dir
1$ docker-compose up
2Creating network "test-docker-django_default" with the default driver
3Pulling db (postgres:)...
4latest: Pulling from library/postgres
5Digest: sha256:9ba6355d27ba9cd0acda1e28afaae4a5b7b2301bbbdc91794dcfca95ab08d2ef
6Status: Downloaded newer image for postgres:latest
7Building web
8Step 1/7 : FROM python:3.6
93.6: Pulling from library/python
10Digest: sha256:6655d57ae9272f09839a25d0ec0d272513663d99a4ad7af8b061c83a76d10295
11Status: Downloaded newer image for python:3.6
12 ---> 13efce2de907
13Step 2/7 : ENV PYTHONUNBUFFERED 1
14 ---> Running in 543c271145c9
15Removing intermediate container 543c271145c9
16 ---> 12d70abf69df
17Step 3/7 : RUN mkdir /code
18 ---> Running in 8f02235b9c79
19Removing intermediate container 8f02235b9c79
20 ---> 52ece72377a2
21Step 4/7 : WORKDIR /code
22 ---> Running in 0b428211651a
23Removing intermediate container 0b428211651a
24 ---> 95db4a2b1a35
25Step 5/7 : ADD requirements.txt /code/
26 ---> 960ba26ba189
27Step 6/7 : RUN pip install pip==19.1.1 --no-cache-dir
28 ---> Running in 19c4c86dae52
29Collecting pip==19.1.1
30 Downloading pip-19.1.1-py2.py3-none-any.whl (1.4 MB)
31Installing collected packages: pip
32 Attempting uninstall: pip
33 Found existing installation: pip 20.1.1
34 Uninstalling pip-20.1.1:
35 Successfully uninstalled pip-20.1.1
36Successfully installed pip-19.1.1
37Removing intermediate container 19c4c86dae52
38 ---> 9299e009e221
39Step 7/7 : RUN pip install -r requirements.txt --no-cache-dir
40 ---> Running in 3bc4f7c645a8
41Collecting Django==3.0.2 (from -r requirements.txt (line 1))
42 Downloading https://files.pythonhosted.org/packages/55/d1/8ade70e65fa157e1903fe4078305ca53b6819ab212d9fbbe5755afc8ea2e/Django-3.0.2-py3-none-any.whl (7.4MB)
43Collecting psycopg2 (from -r requirements.txt (line 2))
44 Downloading https://files.pythonhosted.org/packages/a8/8f/1c5690eebf148d1d1554fc00ccf9101e134636553dbb75bdfef4f85d7647/psycopg2-2.8.5.tar.gz (380kB)
45Collecting sqlparse>=0.2.2 (from Django==3.0.2->-r requirements.txt (line 1))
46 Downloading https://files.pythonhosted.org/packages/85/ee/6e821932f413a5c4b76be9c5936e313e4fc626b33f16e027866e1d60f588/sqlparse-0.3.1-py2.py3-none-any.whl (40kB)
47Collecting pytz (from Django==3.0.2->-r requirements.txt (line 1))
48 Downloading https://files.pythonhosted.org/packages/4f/a4/879454d49688e2fad93e59d7d4efda580b783c745fd2ec2a3adf87b0808d/pytz-2020.1-py2.py3-none-any.whl (510kB)
49Collecting asgiref~=3.2 (from Django==3.0.2->-r requirements.txt (line 1))
50 Downloading https://files.pythonhosted.org/packages/d5/eb/64725b25f991010307fd18a9e0c1f0e6dff2f03622fc4bcbcdb2244f60d6/asgiref-3.2.10-py3-none-any.whl
51Building wheels for collected packages: psycopg2
52 Building wheel for psycopg2 (setup.py): started
53 Building wheel for psycopg2 (setup.py): finished with status 'done'
54 Stored in directory: /tmp/pip-ephem-wheel-cache-xfaezrjm/wheels/fb/85/a8/57f24b92b9554880384d00a84881c0ea80cbcee02d6dcede54
55Successfully built psycopg2
56Installing collected packages: sqlparse, pytz, asgiref, Django, psycopg2
57Successfully installed Django-3.0.2 asgiref-3.2.10 psycopg2-2.8.5 pytz-2020.1 sqlparse-0.3.1
58WARNING: You are using pip version 19.1.1, however version 20.1.1 is available.
59You should consider upgrading via the 'pip install --upgrade pip' command.
60Removing intermediate container 3bc4f7c645a8
61 ---> d15023b3318d
62Successfully built d15023b3318d
63Successfully tagged test-docker-django_web:latest
64Image for service web was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
65Creating test-docker-django_db_1 ... done
66Creating test-docker-django_web_1 ... done
67Attaching to test-docker-django_db_1, test-docker-django_web_1
68db_1 | Error: Database is uninitialized and superuser password is not specified.
69db_1 | You must specify POSTGRES_PASSWORD to a non-empty value for the
70db_1 | superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
71db_1 |
72db_1 | You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
73db_1 | connections without a password. This is *not* recommended.
74db_1 |
75db_1 | See PostgreSQL documentation about "trust":
76db_1 | https://www.postgresql.org/docs/current/auth-trust.html
77web_1 | python3: can't open file 'manage.py': [Errno 2] No such file or directory
78test-docker-django_db_1 exited with code 1
79test-docker-django_web_1 exited with code 2