Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.11 KB

README.md

File metadata and controls

30 lines (21 loc) · 1.11 KB

Play With Docker Docker Hub

Dockerfiles

Finally, Dockerfiles!

Build Patterns

The recommendation is to use multistage builds and, apparently, they're now supported on the Docker Hub! But, you might still find a reason to write a goofy single-stage build.

apt-get

I forget where I first saw this pattern, but the idea is to install all of the packages, including dev/build packages, do the work, then mark all of the unnecessary packages as purgeable.

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        foo \
        bar \
        baz \
    && ... build commands... 
    && apt-mark auto '.*' > /dev/null \
    && apt-mark manual "bar" \
    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
    && rm -fr /var/cache/apt/* /var/lib/apt/lists/*

apk

TBD!