Created
March 12, 2019 20:00
-
-
Save ryanwilsonperkin/0daf26385813196291bf32492802a4ca to your computer and use it in GitHub Desktop.
Comparing the use of apt-get vs apt-fast for installing packages in Debian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A standard Debian container extended with apt-fast (https://github.com/ilikenwf/apt-fast/) | |
FROM debian | |
LABEL maintainer="[email protected]" | |
# Install gnupg to allow apt-key verification, time to allow profiling | |
RUN apt-get update | |
RUN apt-get install -y gnupg time | |
# Set up PPA for apt-fast | |
RUN echo deb http://ppa.launchpad.net/apt-fast/stable/ubuntu bionic main >> /etc/apt/sources.list.d/apt-fast.list \ | |
&& echo deb-src http://ppa.launchpad.net/apt-fast/stable/ubuntu bionic main >> /etc/apt/sources.list.d/apt-fast.list | |
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A2166B8DE8BDC3367D1901C11EE2FF37CA8DA16B | |
RUN apt-get update | |
# Configure apt-fast installation to avoid prompts | |
RUN echo debconf debconf/frontend select Noninteractive | debconf-set-selections | |
RUN echo apt-fast apt-fast/maxdownloads string 10 | debconf-set-selections | |
RUN echo apt-fast apt-fast/dlflag boolean true | debconf-set-selections | |
RUN echo apt-fast apt-fast/aptmanager string apt-get | debconf-set-selections | |
# Install apt-fast | |
RUN apt-get install -y apt-fast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PACKAGES ?= gcc | |
benchmark: apt-get-timing.log apt-fast-timing.log | |
@echo apt-get results: | |
@tail -n 1 apt-get-timing.log | |
@echo apt-fast.log | |
@tail -n 1 apt-fast-timing.log | |
build: | |
docker build -t apt-fast . | |
apt-get-timing.log: build | |
docker run --rm apt-fast time --format=%E apt-get install -y --no-install-recommends $(PACKAGES) > apt-get.log 2> apt-get-timing.log | |
apt-fast-timing.log: build | |
docker run --rm apt-fast time --format=%E apt-fast install -y --no-install-recommends $(PACKAGES) &> apt-fast.log 2> apt-fast-timing.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use it like this: