Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Use host user for Docker builds #98

Merged
merged 1 commit into from
Jun 26, 2019

Commits on Jun 26, 2019

  1. Use host user for Docker builds

    By using the same user inside the container as on the host, we avoid
    issues with the host user lacking the privileges to e.g remove files
    under `build/`, which are bind-mounted from the host into the container.
    
    Before this change, those files would run as the super-user (`id -u` of
    `0`), which caused the issues mentioned above, specifically on Gitlab,
    where subsequent test runners would find themselves unable to clean up
    the `build/` artifacts from prior builds.
    
    The unfortunate edge case here is for users that (wisely!) require
    `sudo` to run `docker` commands, there is no way for the `Makefile`
    to deduce what their non-privileged user's id is. Those users
    need to either deal with the super-user (id `0`, commonly `root`)
    owning the files under `build/`, or to explicitly specify their
    non-privileged user's id when calling `make` commands:
    
    ```
    sudo make BUILDER_UID=$(id -u)
    ```
    hkjn committed Jun 26, 2019
    Configuration menu
    Copy the full SHA
    736aa3d View commit details
    Browse the repository at this point in the history