docker-compose up fails with E: 137
Good day,
Installation fails on mac. Both docker and local
$ docker pull ageron/handson-ml2
$ docker images
ageron/handson-ml2 latest c56ee1943330 14 months ago 5.75GB
$ docker-compose up
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working...
Enabling notebook extension jupyter-js-widgets/extension...
- Validating: OK
done
Installing pip dependencies: ...working... Killed
ERROR: Service 'handson-ml2' failed to build : The command '/bin/sh -c conda update -y -n base conda && echo ' - pyvirtualdisplay' >> /tmp/environment.yml && conda env create -f /tmp/environment.yml && conda clean -y -t && rm /tmp/environment.yml' returned a non-zero code: 137
Tried both docker and local installation. Please help
Ok, so I managed to run my local environment without docker. The issue was silly for someone who is familiar with python: I was using default installation on my mac which is 3.8
python3 --version
but this whole project has 3.7 version requirement and some pip module dependencies just don't work on 3.8
If you are like me, here's a solution on how to install 3.7 as well: https://stackoverflow.com/a/62899833
Coming back to docker: I believe the issue is identical: Dockerfile mentions continuumio/miniconda3 image
FROM continuumio/miniconda3:latest
If you check that image, it uses python 3.8:
$ docker run -i -t continuumio/miniconda3 /bin/bash
(base) root@c27d2a137c9b:/# python3 --version
Python 3.8.5
I wish I could fix this quickly and give you a solution, but I'm not there yet technically. Hopefully this will help you fix it.
Thank you and Happy New Year!
@kartemov you can probably change the version of the image used in the top of the ./docker/Dockerfile e.g FROM continuumio/miniconda3:4.8.3 instead of :latest. It is because 'latest' always point to the latest version. You can check the versions from e.g https://hub.docker.com/r/continuumio/miniconda3/tags?page=1&ordering=last_updated
I'm trying to do the docker-compose up step, will update when I have a running version.
Edit: I updated docker-compose.yml so things should work smoothly now, no need to tag the image.
If you want to pull the image from Docker Hub, then please make sure you tag it as handson-ml2, or else docker-compose up will try to build a new image. I'll clarify this in the README.md:
$ docker pull ageron/handson-ml2 $ docker images ageron/handson-ml2 latest 6c4dc2c7c516 12 hours ago 6.49GB$ docker tag ageron/handson-ml2 handson-ml2 # $ docker-compose up Starting handson-ml2 ... done Attaching to handson-ml2 handson-ml2 | [I 21:32:33.944 NotebookApp] Serving notebooks from local directory: /home/devel/handson-ml2 handson-ml2 | [I 21:32:33.944 NotebookApp] Jupyter Notebook 6.2.0 is running at: ... handson-ml2 | or http://127.0.0.1:8888/?token=...
That said, building a new image should have worked, I'm not sure what went wrong. Could you please give the above a try?
Hi @joustava, @ageron, I've got the same docker issue as @kartemov. Has anyone concluded a resolution?
Thanks
Hi @accmohamedsaber ,
Everything works fine for me, so I'm guessing this issue might have something to do with Docker running out of RAM. You can go to the Docker settings > Resources, and increase the allowed RAM usage. The default is 2GB, but this installation requires more (see this StackOverflow answer for more details).
Does this fix the problem?
Hi @accmohamedsaber ,
Everything works fine for me, so I'm guessing this issue might have something to do with Docker running out of RAM. You can go to the Docker settings > Resources, and increase the allowed RAM usage. The default is 2GB, but this installation requires more (see this StackOverflow answer for more details).
Does this fix the problem?
Hi @ageron,
Thanks for your quick response. Yeah - all works smoothly now using "docker pull ageron/handson-ml2" option.. I was using the other option which is "docker-compose build" this is where I got the error.
For reference, I've managed to get it up and running using docker pull on macOS (no gpu supported). Also, was able to integrate the image container in the vs code.
Thanks again.
I'm glad docker pull ageron/handson-ml2 worked. I also tried reducing the RAM to 2 GB, then I ran docker-compose up and I got the same error as you did (the Killed message). So it looks like this is probably the cause of the problem you got: insufficient RAM. The solution is to go to Docker settings > Resources, and increase the allowed RAM usage. Hope this helps!