Coder Social home page Coder Social logo

docker-images's Introduction

XNAT Docker images

This is a repository of "XNAT ready" docker images which can be used with the XNAT Container Service.

Writing the command(s) into an image

To be "XNAT ready" means the images have one or more commands formatted as a JSON list, serialized as a string, written into the images labels with the key "org.nrg.commands". There is a helper script in this repository to faciliate creating these images.

  1. Write the command that describes your image, and any wrappers that allow XNAT to run it with data, into a json file. I usually call these command.json.
  2. Prepare the Dockerfile for the image.
  3. Before you build the image, add the command(s) to the image's labels with the script:
[docker-images]$ ./command2label.py image-dir/command1.json image-dir/command2.json [other commands] >> image-dir/Dockerfile

The script will produce a Dockerfile instruction that looks like

LABEL "org.nrg.containers"="[{the contents of command1.json}, {the contents of command2.json}, ...]"

By redirecting that output to append to the Dockerfile, the proper labels will be added when building the image.

Releasing an image

The image can be built in the normal way

$ docker build -t your-account/image-name:version image-dir
$ docker push your-account/image-name:version

Typically the images built from the contents of this repo will have the account xnat. Also, it is good practice to use a unique version identifier for each new image build, but to also maintain a latest version which gets updated to point to the most recently built version.

When you are done modifying the command and Dockerfile and other associated files for the image, merge them into the master branch and tag that commit with the image information like this:

$ git tag your-account_image-name_version
$ git push --tags

By tagging the repo in this way, we can always work backwards from an image to find the code that created that particular version of the image.

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.