simon-m-mudd / geemap_docker

A docker container for geemap
MIT License
1 stars 0 forks source link

How was this docker image created? #1

Closed ChHarding closed 3 years ago

ChHarding commented 3 years ago

Hi!

this is NOT an issue with your docker image, I try it and it works fabulously! However, I wonder if you could tell me how you created this image. I'm trying to do something similar but need to include the installation of my own python module and a notebook that uses it. I'm using this https://repo2docker.readthedocs.io/en/latest/getting-started/index.html to build my image which I eventually got to work. However, although creating a geemap "works" (no error is given) the actual map doesn't show up as output. (I can get a simple leaflet map to show up, though ...). I should also say that I'm quite new to docker and may just overlook something simple!

So ... any advise?

Cheers

Chris

simon-m-mudd commented 3 years ago

Hi Chris, I have a few python containers; I basically just copy a working one and then add the extra bells and whistles (or delete bells and whistles) as appropriate. For things that are not on conda-forge, that are my own packages, I usually have a startup script in the container that installs everything. An example is here: https://github.com/LSDtopotools/lsdtt_failtools_docker Here are two other containers: https://github.com/LSDtopotools/lsdtt_pytools_docker https://github.com/simon-m-mudd/landlab_docker Maybe some copy and pasting from there will help you.

You can see how the startup script gets copied in the lsdtt_failtools dockerfile. You should be able to copy over a notebook using the same method. If your packages is quite small (I have some like that) I don't even bother with the script; I just use the "!" command in the notebook. So for example the first line of your noteboook will be: !pip install my_little_package (I've done this yesterday with scikit-image so actually you can do it with rather large packages.) Good luck.

ChHarding commented 3 years ago

Simon,

thanks for your help! After some confusion I finally did manage to build an image that has gee, etc. installed:

https://github.com/ChHarding/TouchTerrain_jupyter_docker https://github.com/ChHarding/TouchTerrain_jupyter_docker

I went with using shell scripts to install/update my own module and a run script to run jupyter. I did struggle with getting a data dir mounted, especially on Windows but I then realized that its possible to download/upload data from and to the container via the browser based file manager the jupiter server offers.

What’s the reason you’re using mamba to install geemap? Does that not work with “vanilla” conda?

install geemap

RUN conda install mamba -y -c conda-forge RUN mamba install geemap -y -c conda-forge RUN mamba install jupyter_contrib_nbextensions -y -c conda-forge

Some small things I found out along the way:

Re docker on Windows, I did find that it’s supposedly possible to install docker on Windows Home: https://docs.docker.com/docker-for-windows/install-windows-home/ https://docs.docker.com/docker-for-windows/install-windows-home/ I don’t have a PC with Win 10 Home so can’t test this but I’m guessing that some of the people using TouchTerrain will have it.

Dockerfile is now supposed to use LABEL for the maintainer instead of MAINTAINER: LABEL maintainer="charding@iastate.edu”

pip is now supposed to be called like this:

import sys !(sys.executable) -m install .

Once again, thanks for your help!

Cheers

Chris

On Feb 5, 2021, at 03:07, Simon Marius Mudd notifications@github.com wrote:

Hi Chris, I have a few python containers; I basically just copy a working one and then add the extra bells and whistles (or delete bells and whistles) as appropriate. For things that are not on conda-forge, that are my own packages, I usually have a startup script in the container that installs everything. An example is here: https://github.com/LSDtopotools/lsdtt_failtools_docker https://github.com/LSDtopotools/lsdtt_failtools_docker Here are two other containers: https://github.com/LSDtopotools/lsdtt_pytools_docker https://github.com/LSDtopotools/lsdtt_pytools_docker https://github.com/simon-m-mudd/landlab_docker https://github.com/simon-m-mudd/landlab_docker Maybe some copy and pasting from there will help you.

You can see how the startup script gets copied in the lsdtt_failtools dockerfile. You should be able to copy over a notebook using the same method. If your packages is quite small (I have some like that) I don't even bother with the script; I just use the "!" command in the notebook. So for example the first line of your noteboook will be: !pip install my_little_package (I've done this yesterday with scikit-image so actually you can do it with rather large packages.) Good luck.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/simon-m-mudd/geemap_docker/issues/1#issuecomment-773898839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYDF5JD6MURGUY7C3TFCBLS5OYOTANCNFSM4XDZHXOQ.

Chris Harding Associate Professor Department of Geological & Atmospheric Sciences

TouchTerrain.geol.iastate.edu