Creating a Dockerfile
Intro:
Now that you have your container working, you need to make a Dockerfile. iPlant won’t pull your image from hub.docker because they have no idea what you’ve put in it. Instead, iPlant wants a Dockerfile that is used to build your container. This is basically the steps you used get your previous container working, but in a single file. They aren’t too hard to make, just follow some best practices and iPlant will be happy.
Details on building images with a Dockerfile: https://docs.docker.com/reference/builder/
Best practices for making a Dockerfile: https://docs.docker.com/articles/dockerfile_best-practices/
Steps:
Write your Dockerfile
Dockerfile for hisat2 based on ubuntu 14.04.3
FROM ubuntu:14.04.3 MAINTAINER Eric Lyons RUN apt-get update && apt-get install -y \ build-essential \ git \ python ENV BINPATH /usr/bin ENV SRCPATH /usr/src ENV HISAT2GIT https://github.com/infphilo/hisat2.git ENV HISAT2PATH $SRCPATH/hisat2 RUN mkdir -p $SRCPATH WORKDIR $SRCPATH RUN git clone "$HISAT2GIT" RUN make -C $HISAT2PATH \ && cp $HISAT2PATH/hisat2 $BINPATH \ && cp $HISAT2PATH/hisat2-* $BINPATH ENTRYPOINT ["/usr/bin/hisat2"]Note: There are options to define default behavior of Docker Image when run.
ENTRYPOINT defines what should be run when the image is run, and is ideal when a tool consists of a single main program.
CMD can also be added to define default arguments to pass to the entrypoint when none are provided; frequently this is used to pass e.g. "–help" by default
To build your docker image:
docker build <directory with Dockerfile>Note: You can add the option: -t <tag> to create an easier to use name for using the docker image
Once built, you can test
docker run <image number>
I think it might be worth adding a note about what
ENTRYPOINTis for (and perhapsCMD, though you don't use that in this file); the rest of what's there is fairly self-explanatory and/or follows from what you did on other pages. Of course the Docker reference pages will cover it in detail, but if you think it wouldn't clutter it up too much, maybe something like "ENTRYPOINT defines what should be run when the image is run, and is ideal when a tool consists of a single main program. CMD can also be added to define default arguments to pass to the entrypoint when none are provided; frequently this is used to pass e.g."–help" by default"