Best practice to use custom config with gremlin-server docker (from Windows)

348 views
Skip to first unread message

Armin Bashizade

unread,
Mar 30, 2020, 12:34:24 PM3/30/20
to Gremlin-users
I want to use gremlin-server in a docker container with custom config (.yaml, .properties, .groovy).
My current solution does not seem like the cleanest way to me:

FROM tinkerpop/gremlin-server:latest

USER root

RUN apk add dos2unix

WORKDIR /opt/gremlin-server

COPY path/to/gremlin-server.yaml ./
COPY path/to/gremlin-graph.properties ./
COPY path/to/script.groovy ./

RUN dos2unix gremlin-server.yaml gremlin-graph.properties script.groovy

USER gremlin

CMD [ "gremlin-server.yaml" ]


I'm creating the image from Windows and I'm sharing the file with other developers who use Windows as well, so I'm running dos2unix as part of the image. Since tinkerpop/gremlin-server changes the user to gremlin, I have to switch to root to install dos2unix and switch back to gremlin.

Is there a cleaner way to install and run dos2unix? What if the user name "gremlin" gets changed in the future? dos2unix aside, is this a good way to override default configurations?

Florian Hockmann

unread,
Apr 1, 2020, 11:04:43 AM4/1/20
to Gremlin-users
Isn't dos2unix basically only switching the line endings from CRLF to LF? I think the much better solution would be to use Unix line endings (LF) for those config files also under Windows. You could configure the line endings for everyone working on those config files for example with an .editorconfig file or with .gitattributes if you're using Git.
Reply all
Reply to author
Forward
0 new messages