Skip to content

Latest commit

 

History

History
126 lines (84 loc) · 7.8 KB

README.md

File metadata and controls

126 lines (84 loc) · 7.8 KB


Debian shelf

Image Dockerfile Pulls Size
dockershelf/debian:bullseye
dockershelf/debian:bookworm
dockershelf/debian:trixie
dockershelf/debian:sid

Building process

You can check out the Dockerfile for each debian release at debian/<release>/Dockerfile. The base filesystem is created with debian/build-image.sh

However, we explain the overall process here:

  1. Built FROM scratch.

  2. Labelled according to label-schema.org and opencontainers specification.

  3. The base filesystem is built with debootstrap using the following command.

     debootstrap --verbose --variant minbase --arch amd64 --no-check-gpg --no-check-certificate --merged-usr <release> <dir>
    
  4. Then the following files are configured:

    • /etc/resolv.conf: DNS servers to be used (google).

        nameserver 8.8.8.8
        nameserver 8.8.4.4
      
    • /etc/locale.gen: Locales to be configured.

        # Dockershelf configuration for locale
        en_US.UTF-8 UTF-8
      
    • /etc/apt/sources.list: Content may vary depending on release. For example, sid does not have security updates.

        # Dockershelf configuration for apt sources
        deb <mirror> <release> main
        deb <mirror> <release>-updates main
        deb <security-mirror> <release>/updates main
      
    • /etc/dpkg/dpkg.cfg.d/dockershelf: Default options to pass to dpkg. Options here are like passing --<option> but without the double hiphens. Check out the manpage for dpkg for more information.

        # Dockershelf configuration for Dpkg
      
        # If a conffile has been deleted by the user and a new version of the
        # package wants to install it, let it do it.
        force-confmiss
      
        # If a package has a new version of a conffile but the user has modified it,
        # answer the question with the default option.
        force-confdef
      
        # If a package has a new version of a conffile but the user has modified it,
        # and there's no default option, replace the conffile with the new one.
        force-confnew
      
        # If a package tries to overwrite a file that exists in another package,
        # let it do it.
        force-overwrite
      
        # Don't call sync() for every IO operation.
        force-unsafe-io
      
    • /etc/apt/apt.conf.d/dockershelf: Default options passed to apt. Check out the manpage for apt.conf and the apt configuration index for more information.

        # Dockershelf configuration for Apt
      
        # Disable creation of pkgcache.bin and srcpkgcache.bin to save space.
        Dir::Cache::pkgcache "";
        Dir::Cache::srcpkgcache "";
      
        # If there's a network error, retry up to 3 times.
        Acquire::Retries "3";
      
        # Don't download translations.
        Acquire::Languages "none";
      
        # Prefer download of xzipped indexes.
        Acquire::CompressionTypes::Order:: "xz";
      
        # Keep indexes gzipped.
        Acquire::GzipIndexes "true";
      
        # Don't check for expired resources
        Acquire::Check-Valid-Until "false";
      
        # Don't install Suggests or Recommends.
        Apt::Install-Suggests "false";
        Apt::Install-Recommends "false";
      
        # Don't ask questions, assume 'yes'.
        Apt::Get::Assume-Yes "true";
        Aptitude::CmdLine::Assume-Yes "true";
      
        # Allow installation of unauthenticated packages.
        Apt::Get::AllowUnauthenticated "true";
        Aptitude::CmdLine::Ignore-Trust-Violations "true";
      
        # Remove suggested and recommended packages on autoremove.
        Apt::AutoRemove::SuggestsImportant "false";
        Apt::AutoRemove::RecommendsImportant "false";
      
        # Cleaning post-hooks for dpkg and apt.
        Apt::Update::Post-Invoke { "/usr/share/dockershelf/clean-apt.sh"; };
        Dpkg::Post-Invoke { "/usr/share/dockershelf/clean-dpkg.sh"; };
      
    • /etc/bash.bashrc: Configure bash-completion and colorful prompt.

  5. Install iproute2, inetutils-ping, locales, curl, ca-certificates and bash-completion packages.

  6. Configure locales.

  7. Delete unnecessary files to shrink image.

Made with 💖 and 🍔

Banner

Web luisalejandro.org · GitHub @LuisAlejandro · Twitter @LuisAlejandro