Skip to content

Commit

Permalink
Erin docs paths (#1156)
Browse files Browse the repository at this point in the history
* updated paths

* updated paths
  • Loading branch information
erinyoung authored Dec 27, 2024
1 parent ca3c71f commit a2db7d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Further documentation can be found at [docs.sylabs.io](https://docs.sylabs.io/gu
- Video training from APHL 2024 workshop **Intermediate Docker Bioinformatics Workshop** can be located in [APHL's e-learning resources](https://learn.aphl.org/learn/course/external/view/elearning/355/intermediate-docker-bioinformatics-workshop)

## Logs
In December 2024, StaPH-B/dockerbuilds underwent a structural change where all Dockerfiles were placed in the subdirectory `build-files`.

In November 2020, Docker began to implement pull rate limits for images hosted on dockerhub. This limits the number of `docker pull`'s per time period (e.g. anonymous users allowed 100 pulls per six hours). We applied and were approved for Docker's "Open Source Program," which should have removed the pull rate limits for all `staphb` docker images! 🎉 🥳 If you encounter an error such as `ERROR: toomanyrequests: Too Many Requests.` or `You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limits.` , please let us know by [submitting an issue.](https://github.com/StaPH-B/docker-builds/issues)

Expand Down
4 changes: 2 additions & 2 deletions docs/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Regardless of how many docker images are available via staphb/docker-builds or o
2. Fork this github repository using the fork button at the top right hand of the github page.
* There are Dockerfile and README templates that can be copied from https://github.com/StaPH-B/docker-builds/tree/master/dockerfile-template and edited
3. Add your Dockerfile, README, and test files to your forked repository following these conventions:
* The first directory should be the name of the program with special characters removed, and it's preferable to remove uppercase - `/spades`
* The second directory should be the version number of the program, in X.X.X format - `/spades/3.12.0`
* The first directory should be the name of the program with special characters removed, and it's preferable to remove uppercase - `/build-files/spades`
* The second directory should be the version number of the program, in X.X.X format - `/build-files/spades/3.12.0`
* The Dockerfile and any other files required for building and testing belong in the sub-directory - `/spades/3.12.0/Dockerfile` and `/spades/3.12.0/my_spades_tests.sh`
* NOTE: There is a file size limit for github (~100MB/file), so if you have a program with a huge database or file of some kind - we won't be able to store the it in our github repository, and that database should be downloaded as part of the Dockerfile instructions with `wget`, `curl`, etc.
4. Please edit the `README.md` and `LICENSE.md` with the appropriate information for your program (follow alphabetical order please!) and commit changes to your forked repo. It's easiest to copy a line for an existing program from the raw markdown documents [README.md](https://raw.githubusercontent.com/StaPH-B/docker-builds/master/README.md) or [LICENSE.md](https://raw.githubusercontent.com/StaPH-B/docker-builds/master/LICENSE.md) and replace the information with your new image.
Expand Down
16 changes: 7 additions & 9 deletions docs/make_containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ Here's a working example of a Dockerfile for the SPAdes software:
```Dockerfile
# FROM defines the base docker image. This command has to come first in the file
# The 'as' keyword lets you name the folowing stage. We use `app` for the production image
FROM ubuntu:xenial as app
FROM ubuntu:jammy AS app

# LABEL instructions tag the image with metadata that might be important to the user
LABEL base.image="ubuntu:xenial"
LABEL base.image="ubuntu:jammy"
LABEL software.version="3.12.0"

# RUN executes code during the build
Expand All @@ -56,7 +56,7 @@ WORKDIR /data

# A second FROM insruction creates a new stage
# Here we add a test stage to run internal tests on the installed software.
FROM app as test
FROM app AS test

RUN spades.py --test
```
Expand All @@ -79,26 +79,24 @@ Fill in [this template](https://github.com/StaPH-B/docker-builds/blob/master/doc
- **Use a standard base image**


We typically use the official docker `ubuntu:xenial` image (Ubuntu 16.04) as our base because it's a reliable and trusted base image and because Ubuntu is the OS we typically work on and are most familiar with.

HOWEVER - Ubuntu Xenial (16.04) is now EOL, so we recommend to use a more recent distro, like Ubuntu Focal (20.04). The offical docker image is called `ubuntu:focal`
We typically use the official docker `ubuntu:jammy` image (Ubuntu 22.04.5 LTS) as our base because it's a reliable and trusted base image and because Ubuntu is the OS we typically work on and are most familiar with.

`alpine` is another frequently used image, and has the added benefit of being smaller than most other images.


- **Minimize the number of layers**

The dockerfile commands (`FROM`, `RUN`, `CMD`, and `COPY`) will each add an additional layer (everytime you use one), increasing the size of the image.
The dockerfile commands (`FROM`, `RUN`, `CMD`, and `COPY`) will each add an additional layer (every time you use one), increasing the size of the image.
There are two ways to reduce the size of your image.

1. As recommended in Docker docs: [utilize the features of a multi-stage build](https://docs.docker.com/develop/develop-images/multistage-build/).
You can use the following Dockerfile structure to isolate installation layers in a builder stage. Then, you can copy only the necessary layers into the production image stage, called "app". This keeps the production image small.
```Dockerfile
FROM ubuntu:xenial as builder
FROM ubuntu:jammy AS builder

# install the program here, using lots of RUN commands

FROM ubuntu:xenial as app
FROM ubuntu:jammy AS app

COPY --from=builder /path/to/<program executable> /usr/local/bin/<program executable>
```
Expand Down

0 comments on commit a2db7d9

Please sign in to comment.