From af3ba200226a9c0ba066d979116f4f117703b55d Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 24 Mar 2021 14:49:29 +0100 Subject: [PATCH 1/6] move dotnet tool restore down after setting usr --- .ci/DockerFile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/DockerFile b/.ci/DockerFile index 715212fa27b..cac7881a0a5 100644 --- a/.ci/DockerFile +++ b/.ci/DockerFile @@ -13,7 +13,6 @@ RUN chown $GROUP_ID:$USER_ID $(pwd) COPY ./*.sln ./nuget.config ./*.Build.props ./*.Build.targets ./ COPY ./dotnet-tools.json ./ -RUN dotnet tool restore # todo standardize on Build.props as Directory.Build.props needs that form COPY ./src/*.Build.props ./src/ @@ -31,13 +30,14 @@ RUN for file in $(find . -name "*.?sproj"); do mkdir -p $(dirname $file)/$(basen COPY build/scripts/scripts.fsproj ./build/scripts/ COPY .ci/Jenkins.csproj ./.ci/ -RUN chown -R $GROUP_ID:$USER_ID $(pwd) RUN chown -R $GROUP_ID:$USER_ID $(pwd) RUN chown -R $GROUP_ID:$USER_ID /tmp/NuGetScratch +RUN rm -rf /tmp/NuGetScratch/lock/ USER user # Install app dependencies -RUN dotnet restore +RUN dotnet restore +RUN dotnet tool restore # copy relevant files (see .dockerignore) COPY . . From 5654936007a9e70018456144bd1eb96bc99e0484 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 24 Mar 2021 15:15:45 +0100 Subject: [PATCH 2/6] tmp fix --- .ci/DockerFile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.ci/DockerFile b/.ci/DockerFile index cac7881a0a5..ab1417ac774 100644 --- a/.ci/DockerFile +++ b/.ci/DockerFile @@ -31,14 +31,12 @@ COPY build/scripts/scripts.fsproj ./build/scripts/ COPY .ci/Jenkins.csproj ./.ci/ RUN chown -R $GROUP_ID:$USER_ID $(pwd) -RUN chown -R $GROUP_ID:$USER_ID /tmp/NuGetScratch -RUN rm -rf /tmp/NuGetScratch/lock/ -USER user - # Install app dependencies +USER user RUN dotnet restore RUN dotnet tool restore + # copy relevant files (see .dockerignore) COPY . . @@ -47,3 +45,5 @@ RUN git rev-parse HEAD . + + From fff6a120ab7eb438f90f6ec92c447462a44eb355 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 24 Mar 2021 15:26:01 +0100 Subject: [PATCH 3/6] tmp fix --- .ci/DockerFile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/DockerFile b/.ci/DockerFile index ab1417ac774..1df5d6f805c 100644 --- a/.ci/DockerFile +++ b/.ci/DockerFile @@ -30,12 +30,12 @@ RUN for file in $(find . -name "*.?sproj"); do mkdir -p $(dirname $file)/$(basen COPY build/scripts/scripts.fsproj ./build/scripts/ COPY .ci/Jenkins.csproj ./.ci/ -RUN chown -R $GROUP_ID:$USER_ID $(pwd) # Install app dependencies -USER user RUN dotnet restore RUN dotnet tool restore +RUN chown -R $GROUP_ID:$USER_ID $(pwd) +RUN chown -R $GROUP_ID:$USER_ID /tmp/NuGetScratch # copy relevant files (see .dockerignore) COPY . . @@ -43,6 +43,7 @@ COPY . . # making sure enough git info is available inside the container RUN git rev-parse HEAD . +USER user From e3c66bf98253bc44f9f208243f07ac8a7eda3654 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 24 Mar 2021 15:37:15 +0100 Subject: [PATCH 4/6] update make bindings --- .ci/make.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/make.sh b/.ci/make.sh index 349a5dc36af..e6638db3d07 100755 --- a/.ci/make.sh +++ b/.ci/make.sh @@ -14,6 +14,7 @@ TASK=$1 TASK_ARGS=() VERSION=$2 STACK_VERSION=$VERSION +REPO_BINDING="$repo:/sln" set -euo pipefail output_folder=".ci/output" @@ -48,6 +49,7 @@ case $CMD in TASK=codegen # VERSION is BRANCH here for now TASK_ARGS=("$VERSION") + REPO_BINDING=${OUTPUT_DIR}:/sln/${output_folder}" ;; *) echo -e "\nUsage:\n\t $CMD is not supported right now\n" @@ -59,7 +61,7 @@ esac docker run \ --env "DOTNET_VERSION" \ --name test-runner \ - --volume "$repo:/sln" \ + --volume $REPO_BINDING \ --rm \ elastic/elasticsearch-net \ ./build.sh $TASK "${TASK_ARGS[@]}" From 167700094c85093267e355a9a2936dabacfc031a Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 24 Mar 2021 15:43:10 +0100 Subject: [PATCH 5/6] Bind on assemble only to output --- .ci/make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/make.sh b/.ci/make.sh index e6638db3d07..839d74d6dbc 100755 --- a/.ci/make.sh +++ b/.ci/make.sh @@ -49,7 +49,7 @@ case $CMD in TASK=codegen # VERSION is BRANCH here for now TASK_ARGS=("$VERSION") - REPO_BINDING=${OUTPUT_DIR}:/sln/${output_folder}" + REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}" ;; *) echo -e "\nUsage:\n\t $CMD is not supported right now\n" From 1bed33ca59b88d9cdeba585ab46e85e87633a15b Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 24 Mar 2021 15:57:03 +0100 Subject: [PATCH 6/6] remove user --- .ci/DockerFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/DockerFile b/.ci/DockerFile index 1df5d6f805c..4d5221c3705 100644 --- a/.ci/DockerFile +++ b/.ci/DockerFile @@ -43,7 +43,7 @@ COPY . . # making sure enough git info is available inside the container RUN git rev-parse HEAD . -USER user +# USER user