Skip to content
Snippets Groups Projects
Commit aa6cdf68 authored by Jeremy M Fee's avatar Jeremy M Fee Committed by GitHub
Browse files

Merge pull request #180 from jmfee-usgs/v0.4.0

v0.4.0
parents c003145d 0fedc98b
No related branches found
No related tags found
No related merge requests found
FROM debian:jessie
FROM usgs/hazdev-base-images:latest-centos AS pycurl-build
MAINTAINER Jeremy Fee <jmfee@usgs.gov>
LABEL usgs.geomag-algorithms.version=0.2.0
# update os
RUN apt-get update --fix-missing && \
apt-get install -y --no-install-recommends \
# install conda dependencies
RUN yum install -y \
bzip2 \
ca-certificates \
curl \
gcc \
libcurl4-gnutls-dev \
libglib2.0-0 \
libgnutls28-dev \
libsm6 \
libxext6 \
libxrender1 && \
apt-get clean
libcurl-devel \
&& \
yum clean all
# install conda
ENV PATH /conda/bin:$PATH
......@@ -27,25 +16,30 @@ RUN echo 'export PATH=/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
/bin/bash ~/miniconda.sh -b -p /conda && \
rm ~/miniconda.sh
# install algorithms and dependencies via conda
RUN conda config --set ssl_verify $SSL_CERT_FILE && \
conda config --add channels obspy && \
conda install --yes jupyter obspy && \
conda clean -i -l -t -y && \
# build pycurl with SFTP support
export PIP_CERT=$SSL_CERT_FILE && \
export PYCURL_SSL_LIBRARY=nss && \
pip install pycurl
# copy library (ignores set in .dockerignore)
COPY . /geomag-algorithms
FROM usgs/hazdev-base-images:latest-centos
MAINTAINER Jeremy Fee <jmfee@usgs.gov>
LABEL usgs.geomag-algorithms.version=0.4.0
# configure DOI SSL intercept certificate
# (required when building image from within DOI network)
RUN mkdir -p /usr/local/share/ca-certificates && \
cp /geomag-algorithms/etc/DOIRootCA2.crt /usr/local/share/ca-certificates/. && \
update-ca-certificates && \
conda config --set ssl_verify /etc/ssl/certs/ca-certificates.crt
# use conda install from build container
ENV PATH /conda/bin:$PATH
COPY --from=pycurl-build /conda /conda
COPY --from=pycurl-build /etc/profile.d/conda.sh /etc/profile.d/conda.sh
# copy library (ignores set in .dockerignore)
COPY . /geomag-algorithms
# install algorithms and dependencies via conda
RUN conda config --add channels obspy && \
conda install --yes jupyter obspy && \
conda clean -i -l -t -y && \
pip install pycurl && \
pip install /geomag-algorithms && \
RUN pip install /geomag-algorithms && \
useradd \
-c 'Docker image user' \
-m \
......@@ -55,7 +49,6 @@ RUN conda config --add channels obspy && \
mkdir -p /home/geomag_user/notebooks && \
chown -R geomag_user:geomag_user /home/geomag_user
USER geomag_user
WORKDIR /home/geomag_user
......
......@@ -88,10 +88,24 @@ Docker is the simplest install option.
from the image `usgs/geomag-algorithms` on docker hub
```
docker run -d --name geomagio -p 8000:80 usgs/geomag-algorithms
docker run -d --name geomagio -p 8000:8000 usgs/geomag-algorithms
```
2. Use the running container
2. Find the token, (the token improves security)
```
docker logs geomagio
```
This outputs a URL to copy/paste into your browser address bar:
```
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8000/?token=TOKEN
```
3. Use the running container
- Run the `geomag.py` command line interface:
......@@ -99,10 +113,10 @@ Docker is the simplest install option.
docker exec -it geomagio geomag.py
```
- Run python interactively in a web browser:
- Run python interactively in a web browser (using the token found in step 2):
```
open http://localhost:8000
http://localhost:8000/?token=TOKEN
```
> In the top right corner, choose "New" then "Python 2"
......
......@@ -2,7 +2,7 @@ from distutils.core import setup
setup(
name='geomag-algorithms',
version='0.3.1',
version='0.4.0',
description='USGS Geomag IO Library',
url='https://github.com/usgs/geomag-algorithms',
packages=[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment