Skip to content

AnthonyMastrean/Dockerfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

Releases

No releases published

Packages

No packages published