Skip to content

Instantly share code, notes, and snippets.

@zorbash
Created September 19, 2017 17:37
Show Gist options
  • Select an option

  • Save zorbash/183b80d37bd0a09434e3a2b1a9589c15 to your computer and use it in GitHub Desktop.

Select an option

Save zorbash/183b80d37bd0a09434e3a2b1a9589c15 to your computer and use it in GitHub Desktop.

Revisions

  1. zorbash created this gist Sep 19, 2017.
    17 changes: 17 additions & 0 deletions docker-autoremove-suggests
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    # File: /etc/apt/apt.conf.d/docker-autoremove-suggests
    # Since Docker users are looking for the smallest possible final images, the
    # following emerges as a very common pattern:

    # RUN apt-get update \
    # && apt-get install -y <packages> \
    # && <do some compilation work> \
    # && apt-get purge -y --auto-remove <packages>

    # By default, APT will actually _keep_ packages installed via Recommends or
    # Depends if another package Suggests them, even and including if the package
    # that originally caused them to be installed is removed. Setting this to
    # "false" ensures that APT is appropriately aggressive about removing the
    # packages it added.

    # https://aptitude.alioth.debian.org/doc/en/ch02s05s05.html#configApt-AutoRemove-SuggestsImportant
    Apt::AutoRemove::SuggestsImportant "false";