简体   繁体   中英

How to run Arangodb on Openshift?

While different database images are available for OpenShift Container Platform users as explained here , others including Arangodb is not yet available. I tried to install Arangodb official container from Dcokerhub by running the following command via Openshift CLI:

oc new-app arangodb

but it does not run successfully throwing the following error:

chown: changing ownership of '/var/lib/arangodb3': Operation not permitted

It is related to permissions. By default, OpenShift runs containers using an arbitrarily assigned user ID and not as the root as documented in Support Arbitrary User IDs section. I tried to chanage the permission of directories and files that may be written to by processes in the image to be owned by the root group and be read/writable by that group in the Dockerfile:

RUN chgrp -R 0 /some/directory \
  && chmod -R g+rwX /some/directory

This time it throws the following error:

FATAL cannot set uid 'arangodb': Operation not permitted

By looking at the script that thatinitializes arangodb ( arangod script), arangodb runs as arangodb:arangodb, which should (or may !!!) be arangodb:0 in the case of Openshift.

Now, I am really confused. I've read and searched a lot:

  1. Getting any Docker image running in your own OpenShift cluster
  2. User namespaces have arrived in Docker!
  3. new-app fails on some official Docker images due to chown permissions
  4. I also tried doing the reverse engineering by looking at mongodb image provided by openshift. But at the end, I got more confused.

I also do not want to ask cluster administrators to allow the project to run as root using:

 # oadm policy add-scc-to-user anyuid -z default

Th more I read, the more I get confused. Has anybody done it before that can provide me a docker container I can run on Openshift?

With ArangoDB 3.4 the docker image has been migrated to an alpine based Image, and its core now shouldn't invoke CHOWN/CHRGRP anymore when invoked in the right way.

This should be one of the requirements to get it working on Openshift.

If you still have problems running ArangoDB on openshift, use the github issue tracker with the specific problems you see. You may also want to try to add changes to the dockerfile, so it can be improved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM