geomagpy / magpy

MagPy (or GeomagPy) is a Python package for analysing and displaying geomagnetic data.
BSD 3-Clause "New" or "Revised" License
49 stars 27 forks source link

Initial Dockerfile #51

Closed jmfee-usgs closed 8 years ago

jmfee-usgs commented 8 years ago

Files to automate docker container image build.

To build the docker image, run the following command from the root of the project directory (after docker is installed and configured):

docker build -t geomagpy/magpy:latest .

To run the built image, run the following command:

docker run -d --name magpy -p 8000:8000 geomagpy/magpy:latest

Then open http://localhost:8000 in a web browser to access the jupiter notebook server. In a new notebook, I was able to run the following python commands to verify the notebook works:

%matplotlib inline
from magpy.stream import read
timeseries = read('http://geomag.usgs.gov/ws/edge/?id=BOU')
timeseries.plot()

I also recommend setting up the docker hub ( https://hub.docker.com/ ) user/organization account "geomagpy" where you can then publish this image for other users using a command similar to:

docker push geomagpy/magpy:latest