summaryrefslogtreecommitdiff
path: root/travis-ci/Dockerfile
diff options
context:
space:
mode:
authorMarek Čermák <prace.mcermak@gmail.com>2018-01-11 11:41:35 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-01-11 11:41:35 +0100
commit99127d20ce69f566be6366afa28cafe9c471725b (patch)
treea962b3beebfe68510c15b0f9f574e5a3fb6e1b87 /travis-ci/Dockerfile
parentd8dab75789ec1ffd53fc06f5f370220ae7b31d9d (diff)
downloadsystemd-99127d20ce69f566be6366afa28cafe9c471725b.tar.gz
Integration of Travis CI and Coverity Scan Analysis (#7691)
- Coverity scan analysis tasks run as scheduled cron jobs - Stage separation for Build, Test and Coverity scan phase - Travis CI now uses Fedora container to build and run tests - Containers are accessible from Docker Hub and failed builds can be reproduced and examined - coverity.sh: separate build and upload
Diffstat (limited to 'travis-ci/Dockerfile')
-rw-r--r--travis-ci/Dockerfile38
1 files changed, 38 insertions, 0 deletions
diff --git a/travis-ci/Dockerfile b/travis-ci/Dockerfile
new file mode 100644
index 0000000000..9554fcfc21
--- /dev/null
+++ b/travis-ci/Dockerfile
@@ -0,0 +1,38 @@
+## Create Dockerfile that builds container suitable for systemd build
+## This container runs as non-root user by deafult
+
+# Use the latest stable version of fedora
+FROM fedora:latest
+
+# Demand the specification of non-root username
+ARG DOCKER_USER
+ARG DOCKER_USER_UID
+ARG DOCKER_USER_GID
+
+# Copy the requirements into the container at /tmp
+COPY requirements.txt /tmp/
+
+# Install the requirements
+# RUN dnf -y update FIXME
+RUN dnf -y install $(cat '/tmp/requirements.txt')
+# clean step to prevent cache and metadata corruption
+RUN dnf clean all
+RUN dnf -y builddep systemd
+
+# Add non-root user and chown the project dir
+RUN groupadd -g $DOCKER_USER_GID $DOCKER_USER
+RUN useradd --create-home --shell /bin/bash -u $DOCKER_USER_UID -g $DOCKER_USER_GID -G wheel $DOCKER_USER
+ENV HOME /home/$DOCKER_USER
+ENV PROJECTDIR $HOME/systemd
+
+# Copy content to the project directory
+COPY . $PROJECTDIR
+
+# Greant user all permissions to the project dir
+RUN chown -R $DOCKER_USER $PROJECTDIR
+
+# Switch to noroot user by default
+USER $DOCKER_USER
+
+# Update workdir to user home dir
+WORKDIR $PROJECTDIR