diff --git a/cmd/gorse-in-one/Dockerfile b/cmd/gorse-in-one/Dockerfile index 3e9b41bf5..6acf028fe 100644 --- a/cmd/gorse-in-one/Dockerfile +++ b/cmd/gorse-in-one/Dockerfile @@ -5,9 +5,6 @@ FROM golang:1.20 COPY . gorse -RUN cd gorse && \ - go get -v -t -d ./... - RUN cd gorse/cmd/gorse-in-one && \ CGO_ENABLED=0 go build -ldflags=" \ -X 'github.com/zhenghaoz/gorse/cmd/version.Version=$(git describe --tags $(git rev-parse HEAD))' \ diff --git a/cmd/gorse-in-one/Dockerfile.windows b/cmd/gorse-in-one/Dockerfile.windows index e3dac4d79..1c52637dd 100644 --- a/cmd/gorse-in-one/Dockerfile.windows +++ b/cmd/gorse-in-one/Dockerfile.windows @@ -5,8 +5,6 @@ FROM golang:1.20 COPY . gorse -RUN cd gorse - ENV CGO_ENABLED 0 RUN cd gorse/cmd/gorse-in-one; \ diff --git a/cmd/gorse-master/Dockerfile b/cmd/gorse-master/Dockerfile index 41df6afcd..bbcb29785 100644 --- a/cmd/gorse-master/Dockerfile +++ b/cmd/gorse-master/Dockerfile @@ -5,9 +5,6 @@ FROM golang:1.20 COPY . gorse -RUN cd gorse && \ - go get -v -t -d ./... - RUN cd gorse/cmd/gorse-master && \ CGO_ENABLED=0 go build -ldflags=" \ -X 'github.com/zhenghaoz/gorse/cmd/version.Version=$(git describe --tags $(git rev-parse HEAD))' \ diff --git a/cmd/gorse-master/Dockerfile.windows b/cmd/gorse-master/Dockerfile.windows index 9ee74eee1..fda6a9136 100644 --- a/cmd/gorse-master/Dockerfile.windows +++ b/cmd/gorse-master/Dockerfile.windows @@ -5,8 +5,6 @@ FROM golang:1.20 COPY . gorse -RUN cd gorse - ENV CGO_ENABLED 0 RUN cd gorse/cmd/gorse-master; \ diff --git a/cmd/gorse-server/Dockerfile b/cmd/gorse-server/Dockerfile index 33edf3b27..c5be0db78 100644 --- a/cmd/gorse-server/Dockerfile +++ b/cmd/gorse-server/Dockerfile @@ -5,9 +5,6 @@ FROM golang:1.20 COPY . gorse -RUN cd gorse && \ - go get -v -t -d ./... - RUN cd gorse/cmd/gorse-server && \ CGO_ENABLED=0 go build -ldflags=" \ -X 'github.com/zhenghaoz/gorse/cmd/version.Version=$(git describe --tags $(git rev-parse HEAD))' \ diff --git a/cmd/gorse-server/Dockerfile.windows b/cmd/gorse-server/Dockerfile.windows index 8293e34d1..041f03177 100644 --- a/cmd/gorse-server/Dockerfile.windows +++ b/cmd/gorse-server/Dockerfile.windows @@ -5,8 +5,6 @@ FROM golang:1.20 COPY . gorse -RUN cd gorse - ENV CGO_ENABLED 0 RUN cd gorse/cmd/gorse-server; \ diff --git a/cmd/gorse-worker/Dockerfile b/cmd/gorse-worker/Dockerfile index f952a3e1c..95522cb09 100644 --- a/cmd/gorse-worker/Dockerfile +++ b/cmd/gorse-worker/Dockerfile @@ -5,9 +5,6 @@ FROM golang:1.20 COPY . gorse -RUN cd gorse && \ - go get -v -t -d ./... - RUN cd gorse/cmd/gorse-worker && \ CGO_ENABLED=0 go build -ldflags=" \ -X 'github.com/zhenghaoz/gorse/cmd/version.Version=$(git describe --tags $(git rev-parse HEAD))' \ diff --git a/cmd/gorse-worker/Dockerfile.windows b/cmd/gorse-worker/Dockerfile.windows index 76360a997..9ca6abc8d 100644 --- a/cmd/gorse-worker/Dockerfile.windows +++ b/cmd/gorse-worker/Dockerfile.windows @@ -5,8 +5,6 @@ FROM golang:1.20 COPY . gorse -RUN cd gorse - ENV CGO_ENABLED 0 RUN cd gorse/cmd/gorse-worker; \ diff --git a/master/rest.go b/master/rest.go index 389eeafb1..ff439bbcb 100644 --- a/master/rest.go +++ b/master/rest.go @@ -249,6 +249,12 @@ func init() { log.Logger().Fatal("failed to load statik files", zap.Error(err)) } staticFileServer = http.FileServer(&SinglePageAppFileSystem{staticFileSystem}) + + // Create temporary directory if not exist + tempDir := os.TempDir() + if err = os.MkdirAll(tempDir, 1777); err != nil { + log.Logger().Fatal("failed to create temporary directory", zap.String("directory", tempDir), zap.Error(err)) + } } // Taken from https://github.com/mytrile/nocache