docker: do not install in /root as it is not accessible to unprivileged user
authorJean Privat <jean@pryen.org>
Mon, 11 Jul 2016 14:21:31 +0000 (10:21 -0400)
committerJean Privat <jean@pryen.org>
Mon, 11 Jul 2016 14:21:31 +0000 (10:21 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

misc/docker/Dockerfile
misc/docker/README.md
misc/docker/full/Dockerfile
misc/docker/hello/Dockerfile

index 95995bf..a1d602c 100644 (file)
@@ -21,8 +21,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
        && rm -rf /var/lib/apt/lists/*
 
 # Clone and compile
-RUN git clone https://github.com/nitlang/nit.git /root/nit \
-       && cd /root/nit \
+RUN git clone https://github.com/nitlang/nit.git /nit \
+       && cd /nit \
        && make \
        && . misc/nit_env.sh install \
        # Clean and reduce size
@@ -30,6 +30,6 @@ RUN git clone https://github.com/nitlang/nit.git /root/nit \
        && ccache -C \
        && rm -rf .git
 
-ENV NIT_DIR /root/nit
+ENV NIT_DIR /nit
 ENV PATH $NIT_DIR/bin:$PATH
 WORKDIR $NIT_DIR
index d255285..73dbba9 100644 (file)
@@ -24,8 +24,8 @@ You can use these images to build then run your programs.
 
 ~~~
 host$ docker run -ti nitlang/nit
-root@ce9b671dd9fc:/root/nit# nitc examples/hello_world.nit
-root@ce9b671dd9fc:/root/nit# ./hello_world
+root@ce9b671dd9fc:/nit# nitc examples/hello_world.nit
+root@ce9b671dd9fc:/nit# ./hello_world
 hello world
 ~~~
 
@@ -37,11 +37,11 @@ In your Dockerfile, write something like:
 FROM nitlang/nit
 
 # Create a workdir
-RUN mkdir -p /root/work
-WORKDIR /root/work
+RUN mkdir -p /work
+WORKDIR /work
 
-# Copy the source code in /root/work/
-COPY . /root/work/
+# Copy the source code in /work/
+COPY . /work/
 
 # Compile
 RUN nitc src/hello.nit --dir . \
index df0d214..fe6fa82 100644 (file)
@@ -63,7 +63,7 @@ ENV ANDROID_NDK /opt/android-ndk
 ENV PATH $PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_NDK
 
 # Run tests
-RUN cd /root/nit/tests \
+RUN cd /nit/tests \
        # Basic tests
        && ./testfull.sh || true \
        && rm -rf out/ alt/*.nit \
@@ -71,6 +71,3 @@ RUN cd /root/nit/tests \
        && ../bin/nitunit ../lib ../contrib || true \
        && rm -rf .nitunit \
        && ccache -C
-
-WORKDIR /root/nit
-ENTRYPOINT [ "bash" ]
index c0a018b..ad7e3cd 100644 (file)
@@ -1,11 +1,11 @@
 FROM nitlang/nit
 
 # Create a workdir
-RUN mkdir -p /root/work
-WORKDIR /root/work
+RUN mkdir -p /work
+WORKDIR /work
 
-# Copy the source code in /root/work/
-COPY . /root/work/
+# Copy the source code in /work/
+COPY . /work/
 
 # Compile
 RUN nitc src/hello.nit --dir . \