cmbi / kmad-web

1 stars 1 forks source link

docker-compose crashes on pip installation #31

Closed joannalange closed 7 years ago

joannalange commented 7 years ago

docker-compose crashes on pip installation I'm runing it with: docker-compose -f docker-compose.yml -f docker-compose-dev.yml run --rm celery nosetests -v --with-coverage --cover-inclusive --cover-package kmad_web tests/integration

Step 40/42 : RUN apt-get install -y python-pip ;    pip install --upgrade pip ;    pip install --no-cache -r requirements.txt
 ---> Running in 319d934d1bbe
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libpython-all-dev python-all python-all-dev python-pip-whl
  python-pkg-resources python-setuptools python-wheel
Suggested packages:
  python-setuptools-doc
The following NEW packages will be installed:
  libpython-all-dev python-all python-all-dev python-pip python-pip-whl
  python-pkg-resources python-setuptools python-wheel
0 upgraded, 8 newly installed, 0 to remove and 10 not upgraded.
Need to get 1583 kB of archives.
After this operation, 3066 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 libpython-all-dev amd64 2.7.11-1 [992 B]
Get:2 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-all amd64 2.7.11-1 [978 B]
Get:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-all-dev amd64 2.7.11-1 [1000 B]
Err:4 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-pip-whl all 8.1.1-2ubuntu0.2
  404  Not Found [IP: 91.189.88.149 80]
Err:5 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-pip all 8.1.1-2ubuntu0.2
  404  Not Found [IP: 91.189.88.149 80]
Get:6 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-pkg-resources all 20.7.0-1 [108 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-setuptools all 20.7.0-1 [169 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial/universe amd64 python-wheel all 0.29.0-1 [48.0 kB]
Fetched 329 kB in 0s (1793 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip-whl_8.1.1-2ubuntu0.2_all.deb  404  Not Found [IP: 91.189.88.149 80]

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip_8.1.1-2ubuntu0.2_all.deb  404  Not Found [IP: 91.189.88.149 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
/bin/sh: 1: pip: not found
/bin/sh: 1: pip: not found
ERROR: Service 'celery' failed to build: The command '/bin/sh -c apt-get install -y python-pip ;    pip install --upgrade pip ;    pip install --no-cache -r requirements.txt' returned a non-zero code: 127

The archives that it's trying to fetch are indeed not there.

jonblack commented 7 years ago

It's possible that because docker caches each step (that's the layers in the docker filesystem), that apt-get update isn't running, and the package archive cache in the container is out-of-date.

You can force recreation of everything, or better yet, move the installation of pip to the top right after the update:

RUN apt-get update
RUN apt-get install -y build-essential git wget gfortran python-pip
...
...
// Lots of stuff here
...
...
COPY requirements.txt .
RUN pip install --upgrade pip ;\
    pip install --no-cache -r requirements.txt