Giter Club home page Giter Club logo

gmt-docker's Introduction

gmt-docker

Homepage

Docker Hub Link

Docker Image of Generic Mapping Tools GMT HomePage, as well as GMT/Python

Instructions Adapted from GMT Wiki

Host Requirements

  • docker
  • docker-compose (0ptional)

Tags

Docker Container Images are available https://hub.docker.com/r/nc5ng/gmt

The following tags are provided.

  • latest Latest gmt upstream trunk code. Currently following 6.0.0 Development. Updated regularly, but not on every commit
  • python , GMT/Python pre-installed. Updated every time latest is updated
  • jupyter enhanced python image with jupyter online notebook, same version of gmt as latest and updated at the same time.
  • 6, 6-python, 6-jupyter more stable images featuring 6.0 builds that are verified to work. Updated occasionally
  • 6.0.0_r20469, 6.0.0_r20469-python, 6.0.0_r20469-jupyter, ... Fixed tags for specific commits and build numbers (Never Updated)

Usage

Docker

Print Help:

$ docker run -it --rm nc5ng/gmt --help

Start a local Shell:

$ docker run -it --rm --entrypoint /bin/bash nc5ng/gmt

Using Docker with local files:

By default, image operates in directory "/workspace"

# All paths in current dir are valid
$ docker run -it --rm -v "$PWD:/workspace" nc5ng/gmt surface 

Run a gmt command and save output locally:

$ docker run --rm nc5ng/gmt pscoast -JM10.0i -R235.0/294.0/24.0/50.0 -C blue -N2  > conus.ps

Starting a GMT/Python session in ipython:

$ docker run -it --rm nc5ng/gmt:python

**Starting a jupyter notebook session

$ docker run -p "8888:8888" -it --rm -v "$PWD:/workspace"  nc5ng/gmt:jupyter

Then, connect to the device using the IP of the host computer (or local host) and the secure token printed on the command line.

Command Line Wrapper

Download the command line wrapper from the git repository

# Get Code
$ git clone https://github.com/nc5ng/gmt-docker
# Alternate
$ wget https://raw.github.com/nc5ng/gmt-docker/master/gmt.sh


# /home/user/bin is usually on path
# alternatives : /usr/local/bin
$ mkdir -p ~/bin
$ cp gmt-docker/gmt.sh ~/bin/gmt
$ chmod +x ~/bin/gmt
$ gmt --version
6.0.0_r19736

# plot something
$ gmt pscoast -JM10.0i -R235.0/294.0/24.0/50.0 -Cblue -N2  > conus.ps

The wrapper script is a simplistic shortcut, feel free to use the same approach to define an alias or your own ~/bin/gmt convenience script. The docker tag can be specified with environment variable $DOCKER_GMT_VERSION.

NOTE: Docker is a container environment similar to a Virtual Machine, scripts that rely on absolute paths when using GMT tools should extend the container to package the data. When run in convenience script, only the local directory (and subdirectories) are hosted in the docker environment

Advanced Docker Usage

Extending Container:

Complex data processing pipelines are well served by docker images. They can be shared by multiple people easily, with all dependencies and data in place.

The easiest way to integrate your complex data set with the docker image is to extend the image

# Extend Python Image
FROM nc5ng/gmt:python

# Add local directory data
ADD ./ /workspace

# Install custom requirements
RUN pip install -r /workspace/requirements.txt

# Use your command as entrypoint for container
ENTRYPOINT /workspace/my_processing_script.sh

Usage: docker-compose

docker-compose can be used to orchestrate conversions

version: '2'
services:

  step-1:
    image: nc5ng/gmt
    volumes:
      - "/path/to/dataroot:/workspace:rw"
    command: surface test.xyz
      
  step-2:
    image: nc5ng/gmt
    
    volumes:
      - "/path/to/dataroot:/workspace:rw"
    command: -JM10.0i -R235.0/294.0/24.0/50.0 -Cblue -N2  > conus.ps
    
$ docker-compose run step-1
$ docker-compose run step-2

gmt-docker's People

Contributors

akshmakov avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

josteinl

gmt-docker's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.