1 ## Create Dockerfile that builds container suitable for systemd build
2 ## This container runs as non-root user by deafult
6 # Demand the specification of non-root username
11 # Copy the requirements into the container at /tmp
12 COPY requirements.txt /tmp/
14 # Install the requirements
15 # RUN dnf -y update FIXME
16 RUN dnf -y install $(cat '/tmp/requirements.txt')
17 # clean step to prevent cache and metadata corruption
19 RUN dnf -y builddep systemd
21 # Add non-root user and chown the project dir
22 RUN groupadd -g $DOCKER_USER_GID $DOCKER_USER
23 RUN useradd --create-home --shell /bin/bash -u $DOCKER_USER_UID -g $DOCKER_USER_GID -G wheel $DOCKER_USER
24 ENV HOME /home/$DOCKER_USER
25 ENV PROJECTDIR $HOME/systemd
27 # Copy content to the project directory
30 # Greant user all permissions to the project dir
31 RUN chown -R $DOCKER_USER $PROJECTDIR
33 # Switch to noroot user by default
36 # Update workdir to user home dir