From a2db7d98ea75bba5056befcad7513e99b3d74406 Mon Sep 17 00:00:00 2001 From: Young Date: Fri, 27 Dec 2024 11:40:18 -0700 Subject: [PATCH] Erin docs paths (#1156) * updated paths * updated paths --- README.md | 1 + docs/contribute.md | 4 ++-- docs/make_containers.md | 16 +++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8be427b5b..c9a0326d6 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/contribute.md b/docs/contribute.md index 2c1ef4be9..853fd9596 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -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. diff --git a/docs/make_containers.md b/docs/make_containers.md index 878747ef9..1ae52031c 100644 --- a/docs/make_containers.md +++ b/docs/make_containers.md @@ -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 @@ -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 ``` @@ -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/ /usr/local/bin/ ```