Commit 7aec7274 authored by David Yu Yuan's avatar David Yu Yuan
Browse files

Merge branch 'latest' into 'master'

Latest

See merge request !51
parents 36b58f42 2548337a
......@@ -11,6 +11,6 @@ EMBL-EBI Cloud Portal documentation
* Presentations on UKRI 2019
* `EMBL-EBI Cloud Portal for Everyone <../_static/pdf/ukri2019/EMBL-EBICloudPortalforEveryone.pdf>`_
* `Case Study of Porting Rfam Pipeline into Cloud <../_static/pdf/ukri2019/CaseStudyofPortingRfamPipelineintoCloud.pdf>`_
.. * `Porting RFAM to Cloud Portal <https://drive.google.com/open?id=1NWtV0NlBErY_5ueDnJp60m0nsrkIgtKf>`_
\ No newline at end of file
.. * `Case Study of Porting Rfam Pipeline into Cloud <../_static/pdf/ukri2019/CaseStudyofPortingRfamPipelineintoCloud.pdf>`_
.. * `Porting RFAM to Cloud Portal <https://drive.google.com/open?id=1NWtV0NlBErY_5ueDnJp60m0nsrkIgtKf>`_
## Exercise 1 ##
## Exercise 1: Running images ##
### Objective ###
......
## Exercise 2 ##
## Exercise 2: Removing images from your machine (optional) ##
### Objective ###
......
## Exercise 3 ##
## Exercise 3: Running a bioinfomatics application ##
### Objective ###
......
## Exercise 4 ##
## Exercise 4: Creating your own docker image ##
### Objective ###
......
## Exercise 5 ##
## Exercise 5: Optimising a docker image ##
### Objective ###
Learn how to optimise a docker image
### Create your own Dockerfile from scratch ###
### Optimisation summary ###
- Pick an application that you care about, be it a bioinformatic application or something else (web-server, database, compiler, R-Shiny app, anything).
- Write a Dockerfile for it and make sure it works.
- Then check the best-practices from the slides and see how you can optimise your image
There are a lot of best-practice guidelines out there, but they can be summarised in just two questions:
- If I run the build in a year from now, on a clean machine, will I get the same result? What might change that would give me a different result?
- What does each line in the Dockerfile do to the image, to the cache?
There are a lot of best-practice guidelines out there, but they can be summarised as follows: For each line of your Dockerfile, ask yourself two questions
- If I run the build in a year from now, on a clean machine, will I get the same result from this line? What might change that gives me a different result?
- Does this line bring in things that I don't need, so it bloats my image?
As for image size, how big is too big? It really does depend on what you're doing, and anything less than 200 MB or so is excellent. Beyond 1 GB, you're probably carrying a lot of stuff you don't need, and performance may suffer for it.
How big is too big? It really does depend on what you're doing, and anything less than 200 MB or so is fine. Beyond 1 GB, you're probably carrying a lot of stuff you don't need, and performance may suffer for it.
Software like R, Perl or Python (conda) tend to drag in a lot of packages depending on how they're installed, so watch out for them. Sometimes you can clean things up (e.g. **conda clean --all**), or you may need to install things manually, to keep control.
Software like R, Perl or Python (conda) tend to drag in a lot of packages depending on how they're installed, so watch out for them. Also, many providers of base OS images have slimmed-down versions that you can use if you don't want everything.
Also, many providers of base OS images have slimmed-down versions that you can use if you don't want everything. E.g. There's a **debian:jessie** (129 MB) and a **debian:jessie-slim** (81 MB).
If you can't think of an application you'd like to build an image for, you can start with **Dockerfile.spades** in the **tsi-cc/ResOps/scripts/docker** directory. This builds a container for the Spades assembler, it takes about 15 minutes to run, and the resulting container is about 5.5 GB in size. You can get it down to 3 minutes and 1.3 GB very easily. Can you do better than that?
### Optimise a Dockerfile ###
Take a look at **Dockerfile.spades** in the **tsi-cc/ResOps/scripts/docker** directory. This builds a container for the Spades assembler, it takes about 15 minutes to run, and the resulting container is about 5.5 GB in size.
- Following the guidelines in this tutorial, can you get it down to 3 minutes and 1.3 GB?
- Can you reduce the size even further than that, to 750 MB or less?
### Conclusion ###
If you got this far, congratulations, you're an expert!
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment