From e4d98082dc53cac1ee47bfcf94c35c5e56b4b840 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Sat, 14 Jan 2017 14:22:39 +1300 Subject: [PATCH] fix(api): disable data directory creation (#495) * fix(api): disable data directory creation * feat(dockerhub): update volume instruction value for Windows Dockerfiles --- api/file/file.go | 12 +++++++----- build/windows/microsoftservercore/Dockerfile | 2 +- build/windows/nanoserver/Dockerfile | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/api/file/file.go b/api/file/file.go index c9ad71a4a..63837d525 100644 --- a/api/file/file.go +++ b/api/file/file.go @@ -34,12 +34,14 @@ func NewService(dataStorePath, fileStorePath string) (*Service, error) { fileStorePath: path.Join(dataStorePath, fileStorePath), } - err := createDirectoryIfNotExist(dataStorePath, 0755) - if err != nil { - return nil, err - } + // Checking if a mount directory exists is broken with Go on Windows. + // This will need to be reviewed after the issue has been fixed in Go. + // err := createDirectoryIfNotExist(dataStorePath, 0755) + // if err != nil { + // return nil, err + // } - err = service.createDirectoryInStoreIfNotExist(TLSStorePath) + err := service.createDirectoryInStoreIfNotExist(TLSStorePath) if err != nil { return nil, err } diff --git a/build/windows/microsoftservercore/Dockerfile b/build/windows/microsoftservercore/Dockerfile index dfcd8b15a..5d67a2899 100644 --- a/build/windows/microsoftservercore/Dockerfile +++ b/build/windows/microsoftservercore/Dockerfile @@ -2,7 +2,7 @@ FROM microsoft/windowsservercore COPY dist / -VOLUME C:\\data +VOLUME C:\\ProgramData\\Portainer WORKDIR / diff --git a/build/windows/nanoserver/Dockerfile b/build/windows/nanoserver/Dockerfile index ae8a25a39..7855cba8e 100644 --- a/build/windows/nanoserver/Dockerfile +++ b/build/windows/nanoserver/Dockerfile @@ -2,7 +2,7 @@ FROM microsoft/nanoserver COPY dist / -VOLUME C:\\data +VOLUME C:\\ProgramData\\Portainer WORKDIR /