Closed Nick-OpusVL closed 5 years ago
This is because we need to write /root/gitstatus.txt and do other stuff as root.
$ make docker docker build \ --build-arg version=`dzil distversion` \ --build-arg gitrev="`set -x ; git rev-parse HEAD ; git status ; git diff`" \ -t quay.io/opusvl/kingfisher-website:latest . + git rev-parse HEAD + git status + git diff Sending build context to Docker daemon 89.09kB Step 1/13 : FROM quay.io/opusvl/fb11 ---> 69d484dd98a9 Step 2/13 : MAINTAINER OpusVL <support@opusvl.com> ---> Running in 09f950238d75 Removing intermediate container 09f950238d75 ---> fff87b1f2003 Step 3/13 : ARG version ---> Running in 306312d685e4 Removing intermediate container 306312d685e4 ---> 62c95f666232 Step 4/13 : RUN if [ -z "$version" ]; then echo "No version specified"; exit 1; fi ---> Running in b37e6fb7fdee Removing intermediate container b37e6fb7fdee ---> 268e0ea6f8bc Step 5/13 : ARG gitrev ---> Running in b0d075e7ecb9 Removing intermediate container b0d075e7ecb9 ---> 2430cca8b2f8 Step 6/13 : RUN if [ -z "$gitrev" ]; then echo "No gitrev provided"; exit 1; fi ---> Running in 7755479ccc79 Removing intermediate container 7755479ccc79 ---> a405e17f4575 Step 7/13 : RUN echo "$gitrev" > /root/gitstatus.txt ---> Running in fba502fcfacd /bin/sh: 1: cannot create /root/gitstatus.txt: Permission denied The command '/bin/sh -c echo "$gitrev" > /root/gitstatus.txt' returned a non-zero code: 2 Makefile:15: recipe for target 'docker' failed make: *** [docker] Error 2
These errors are fixed but see also #7
This is because we need to write /root/gitstatus.txt and do other stuff as root.