]> git.ipfire.org Git - thirdparty/systemd.git/blame - travis-ci/Dockerfile
sd-bus: let's better not invade stdio territory when duplicating fds
[thirdparty/systemd.git] / travis-ci / Dockerfile
CommitLineData
99127d20
1## Create Dockerfile that builds container suitable for systemd build
2## This container runs as non-root user by deafult
3
4# Use the latest stable version of fedora
5FROM fedora:latest
6
7# Demand the specification of non-root username
8ARG DOCKER_USER
9ARG DOCKER_USER_UID
10ARG DOCKER_USER_GID
11
12# Copy the requirements into the container at /tmp
13COPY requirements.txt /tmp/
14
15# Install the requirements
16# RUN dnf -y update FIXME
17RUN dnf -y install $(cat '/tmp/requirements.txt')
18# clean step to prevent cache and metadata corruption
19RUN dnf clean all
20RUN dnf -y builddep systemd
21
22# Add non-root user and chown the project dir
23RUN groupadd -g $DOCKER_USER_GID $DOCKER_USER
24RUN useradd --create-home --shell /bin/bash -u $DOCKER_USER_UID -g $DOCKER_USER_GID -G wheel $DOCKER_USER
25ENV HOME /home/$DOCKER_USER
26ENV PROJECTDIR $HOME/systemd
27
28# Copy content to the project directory
29COPY . $PROJECTDIR
30
31# Greant user all permissions to the project dir
32RUN chown -R $DOCKER_USER $PROJECTDIR
33
34# Switch to noroot user by default
35USER $DOCKER_USER
36
37# Update workdir to user home dir
38WORKDIR $PROJECTDIR