Skip to content

adeslatt/samtools-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker Image CI

samtools-docker

Samtools build done with v1.16.1

In this case, the conda install does not work -- instead, this Dockerfile gets the release.

Samtools

Steps to build this docker container.

  1. Determine the dependencies by iterative running of .configure
  2. Use ubuntu base image
  3. get each of the dependencies
  4. run the steps specified for building and installing

To edit the files:

  1. Use a simple editor (Text Edit on Mac is fine) - we want to be cautious about unseen characters
  2. Use emacs (can be installed with conda)
conda install -c conda forge emacs

To build your image from the command line:

  • Can do this on Google shell - docker is installed and available
docker build -t samtools:v1.16.1 .

To test this tool from the command line

Set up an environment variable capturing your current command line:

PWD=$(pwd)

Then mount and use your current directory and call the tool now encapsulated within the environment.

Any samtools command can be used to check.

docker run -it -v $PWD:$PWD -w $PWD samtools:v1.16.1 samtools --version

(Optional) Deposit your container in the your CAVATICA Docker Registry

If you are working with Kids First or INCLUDE data, and you are registered with either the Kids First DRC or the INCLUDE Data Hub, you have access to a platform as a service, CAVATICA by Seven Bridges.

If you do, you Docker Image Repository Specific to you is at the location of pgc-images.sbgenomics.com/[YOUR CAVATICA USERNAME]

There are three steps to building and using a container

  1. build
  2. tag
  3. push

We have built and we did tag this (I built the above on my desktop which is a mac, but it could have been built within a google shell. Examples of how to do this are found in the Elements of Style in Workflow Creation and Maintenance, Day 3

Tag

To tag the image just built, you need the image id, to get that simply use the command docker images.

docker images
REPOSITORY                                           TAG       IMAGE ID       CREATED          SIZE
samtools                                            latest    0ca8aaf01be0   16 minutes ago   1.53GB

Now we re-tag it for pushing to our own personal CAVATICA docker container registry.

docker tag 0ca8aaf01be0 pgc-images.sbgenomics.com/[YOUR CAVATICA USERID]/samtools:v1.16.1

Docker registry login

There is actually another step required before you can do your push to the registry. You need to authenticate.

Navigate to the CAVATICA Developers Tab.

Select Authentication Token, if you have not done so, generate that token.

Then Copy the token and paste it in the proper location in the command below (after -p for password)

docker login pgc-images.sbgenomics.com -u [YOUR CAVATICA USERNAME] -p [YOUR AUTHENTICATION TOKEN]

Push

Now that we have

  • tagged :whitecheck our docker image and

  • we have authenticated :whitecheck

docker push pgc-images.sbgenomics.com/[YOUR CAVATICA USERNAME]/samtools:v1.16.1

You know things are going correctly when you see something to the effect of:

The push refers to repository [pgc-images.sbgenomics.com/deslattesmaysa2/samtools:v1.16.1]
ea25457229f1: Pushed 
17280cc0fa6b: Pushed 
ab2731ec3f53: Pushed 
6fa1f4185aa2: Pushed 
ad6562704f37: Pushed 
latest: digest: sha256:3b1976baa7c4aaa2afd25098c41c754e2579060b6c1da32282c45ac8a10293a9 size: 1373

About

Build a Container for samtools v1.16.1

Resources

License

Stars

Watchers

Forks

Packages