From 78409f033cc3a647fea9cbf2d43c5082250dbf28 Mon Sep 17 00:00:00 2001 From: Aravindh Puthiyaparambil Date: Thu, 16 Apr 2020 15:24:38 -0400 Subject: [PATCH] [ci] Fix failure of e2e hack script Problem: hack/run-ci-e2e-test.sh fails in the following manner as observed when working on https://github.com/openshift/release/pull/8323: ``` failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied Error: failed to build test binary: ... ``` Solution: Preemptively create the go cache directory in the image being built by CI. --- build/Dockerfile | 5 +++++ build/Dockerfile.ci | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/build/Dockerfile b/build/Dockerfile index 3dce36b31c..1d84487db8 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -2,6 +2,11 @@ FROM golang:1.13.8 as build LABEL stage=build +# Create cache directory as user running the tests doesn't have the permissions to create it at runtime. This is required +# for the go builds below to succeed +RUN mkdir /go/.cache +ENV GOCACHE="/go/.cache" + # Build WMCB RUN mkdir /build/ WORKDIR /build/ diff --git a/build/Dockerfile.ci b/build/Dockerfile.ci index 2ec3dd96e1..3c2287c4bb 100644 --- a/build/Dockerfile.ci +++ b/build/Dockerfile.ci @@ -7,6 +7,11 @@ FROM golang:1.13.8 as build LABEL stage=build +# Create cache directory as user running the tests doesn't have the permissions to create it at runtime. This is required +# for the go builds below to succeed +RUN mkdir /go/.cache +ENV GOCACHE="/go/.cache" + # Build WMCB RUN mkdir /build/ WORKDIR /build/