Dear FAI Users:

Here's the abridged version of my question: How do I add a 3rd party
package repository and then install software from it?

Now here's the longer version.

I want to install Docker CE ( on a
Debian Stretch system using FAI. The official Docker documentation
recommends that you install Docker using their package repository (
I'm not sure how do this with FAI.

The given instructions for installing Docker are as follows.

1. Install packages to allow apt to use a repository over HTTPS:

    sudo apt-get -y install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg2 \

2. Add Docker's official GPG key to APT:

    curl \
    -fsSL \$(. /etc/os-release; echo "$ID")/gpg \
    | sudo apt-key add -

3. Add the Docker repository to APT:

    sudo add-apt-repository \
    "deb [arch=amd64]$(.
/etc/os-release; echo "$ID") \
    $(lsb_release -cs) \

4. Update the APT package index:

    sudo apt-get update

5. Install the docker-ce package:

    sudo apt-get install docker-ce

Here is my solution attempt. I decided to create an FAI class called DOCKER
for this installation.

First I create the following hook for the DOCKER class


    # Install required packages for add-apt-repository utility
    sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg2 \

    # Add the Docker repository
    sudo add-apt-repository \
    "deb [arch=amd64]$(.
/etc/os-release; echo "$ID") \
    $(lsb_release -cs) \

Next I download the Docker repository public key and placed it in the FAI
package configuration directory at the following path:


Then I create the following package configuration file for the DOCKER class

    # Install Docker CE (Community Edition)
    PACKAGES install

Finally I perform a dirinstall/chroot installation using the DOCKER class:

    sudo fai \
    --verbose \
    --cfdir '/etc/fai' \
    --cspace 'file:///srv/fai/config' \
    dirinstall 'docker'

Then I enter the chroot environment to check whether or not the
installation was successful:

    sudo chroot docker

Unfortunately when I check for docker it does not appear to be installed:

    root@faiserver:/# which docker
    root@faiserver:/# dpkg -l | grep -i docker

Checking the log files for evidence of the docker-ce package yields the

    root@faiserver:/# grep -Fir docker-ce
    WARNING: These unknown packages are removed from the installation list:

I also look for evidence that the add-apt-repository command was executed,
but don't find any:

    root@faiserver:/# grep -Firl add-apt-repository /var/log/fai

However I am able to verify that the key was added to APT successfully:

    root@faiserver:/# apt-key list 2>/dev/null | grep -i -B2 -A1 docker
    pub   rsa4096 2017-02-22 [SCEA]
          9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
    uid           [ unknown] Docker Release (CE deb) <>
    sub   rsa4096 2017-02-22 [S]

Any suggestions would be greatly appreciated.


Antwort per Email an