Hi all

I'm trying to migrate my docker based BaseX app to OpenShift Enterprise and after building and deploying successfully the container it can not start due to the following strange permission problem:


1 /srv/.basex could not be written.
2 java.nio.file.AccessDeniedException: /srv/.basex
3 at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
4 at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
5 at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
6 at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
7 at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:430)
8 at java.nio.file.Files.newOutputStream(Files.java:172)
9 at java.nio.file.Files.write(Files.java:3092)
10 at org.basex.io.IOFile.write(IOFile.java:221)
11 at org.basex.util.options.Options.write(Options.java:143)
12 at org.basex.util.options.Options.read(Options.java:696)
13 at org.basex.util.options.Options.<init>(Options.java:95)
14 at org.basex.core.StaticOptions.<init>(StaticOptions.java:115)
15 at org.basex.core.Context.<init>(Context.java:78)
16 at org.basex.core.Context.<init>(Context.java:70)
17 at org.basex.http.HTTPContext.init(HTTPContext.java:424)
18 at org.basex.BaseXHTTP.<init>(BaseXHTTP.java:69)
19 at org.basex.BaseXHTTP.main(BaseXHTTP.java:52)
20 /srv/.basex: writing new configuration file.
21 DEBUG: true
22 Creating Database...
23 . 4.61 ms (18501 KB)
24 Creating /srv/BaseXWeb/WEB-INF/web.xml
25 java.nio.file.NoSuchFileException: /srv/BaseXWeb/WEB-INF/web.xml
26 at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
27 at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
28 at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
29 at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
30 at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:430)
31 at java.nio.file.Files.newOutputStream(Files.java:172)
32 at java.nio.file.Files.write(Files.java:3092)
33 at org.basex.io.IOFile.write(IOFile.java:221)
34 at org.basex.BaseXHTTP.locate(BaseXHTTP.java:264)
35 at org.basex.BaseXHTTP.initJetty(BaseXHTTP.java:219)
36 at org.basex.BaseXHTTP.<init>(BaseXHTTP.java:75)
37 at org.basex.BaseXHTTP.main(BaseXHTTP.java:52)
38 /srv/BaseXWeb/WEB-INF/web.xml


In my Docker file I simply copy some files (the same errors occurs when the last line in the Docker file is omitted, so there's no difference if the .basex file is added or not):

FROM basex/basexhttp:latest
MAINTAINER MyName <my.name@domain.com>
VOLUME ["/srv/BaseXData", "/srv/BaseXWeb"]
COPY lib/*.jar /usr/src/basex/basex-core/lib/
COPY data/users.xml /srv/BaseXData/
COPY web/test.xq /srv/BaseXWeb/
COPY .basex /srv/.basex



I'm not sure if the problem is OpenShift related or if it is based on the way the basex server is started...

Any ideas?

Thx.
Mike