From 4ea6ee4d6a2c2fe8170dae086cf4c80590ccc5c4 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Mon, 16 Dec 2019 17:03:29 +0000 Subject: Reorganise Dockerfile to have KLEE user own the build directory --- .dockerignore | 1 + Dockerfile | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.dockerignore b/.dockerignore index 11d13733..b90cbfa2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ autom4te.cache **/.*.swp Dockerfile +cmake-*/ diff --git a/Dockerfile b/Dockerfile index 4a307e01..6ed74887 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,10 +32,9 @@ ENV MINISAT_VERSION=master ENV Z3_VERSION=4.8.4 ENV USE_LIBCXX=1 ENV KLEE_RUNTIME_BUILD="Debug+Asserts" - -COPY . /tmp/klee_src/ -RUN /tmp/klee_src//scripts/build/build.sh --debug --install-system-deps klee LABEL maintainer="KLEE Developers" + + # TODO remove adding sudo package # Create ``klee`` user for container with password ``klee``. # and give it password-less sudo access (temporarily so we can use the TravisCI scripts) @@ -46,11 +45,14 @@ RUN apt update && apt -y --no-install-recommends install sudo emacs vim file && cp /etc/sudoers /etc/sudoers.bak && \ echo 'klee ALL=(root) NOPASSWD: ALL' >> /etc/sudoers +# Copy across source files needed for build +COPY --chown=klee:klee . /tmp/klee_src/ + +# Build and set klee user to be owner +RUN /tmp/klee_src/scripts/build/build.sh --debug --install-system-deps klee && chown -R klee:klee /tmp/klee_build* + ENV PATH="$PATH:/tmp/llvm-60-install_O_D_A/bin:/home/klee/klee_build/bin" ENV BASE=/tmp -# Copy across source files needed for build -# Set klee user to be owner -ADD --chown=klee:klee / ${BASE}/klee_src USER klee WORKDIR /home/klee -- cgit 1.4.1