Basemap is a large package to install and I wanted to have an easy way to make basemap plots on a varitey of different machines, so I created a Dockerfile with basemap, numpy, matplotlib etc.
- Clone this repository. If you're on Windows or MacOS make sure you clone it somewhere
in a user folder
(Windows:
//C/users/username/easy_plots
, MacOS:/Users/easy_plots/media
).
git clone https://github.com/MiCurry/easy_plots.git
-
Install Docker if you haven't.
-
Build the Docker image by running. This will take some time. Let me know if there's any errors..
docker build -t basemap .
- Mount Point Before you start running you'll need to pick a mount directory so the Docker container can create a data volume to save files it downloads and plots it saves as well as allowing you to see plots it creates.
This mount directory needs to point to the directory data contained within
this repository. You'll need to remember this direcotry path (best to write it
down). Mine is //c/users/miles/projects/easy_plots/data
.
- Create plots by using the docker run command and mounting the volume. You'll use this volume each time you want to plot! Make sure you use it each time else you wont be using the data you've already generated.
The basic structure of the run command is:
docker run -v [your-mount-direcotyr]:/home/data basemap <command>
Here is mine as an example:
docker run -v /c/Users/Miles/Projects/easy_plots/data:/home/data basemap <command-line-options>
docker run -v /c/Users/Miles/Projects/easy_plots/data:/home/data basemap touch data/new_file.txt # Create a test file
docker run -v /c/Users/Miles/Projects/easy_plots/data:/home/data basemap ls data # See if our file was created
Then see if the new_file.txt
was created in /c/Users/Miles/Projects/easy_plots/data.