Using Docker, initialising ArangoDB from Python
Tried different ways to authenticate, always getting "error: database is uninitialized and password option is not specified"
Not sure how to format / connect ArangoDB
import docker
client=docker.from_env()
img=client.images.pull("arangodb:latest")
[31]:
arangocommand="-e ARANGO_RANDOM_ROOT_PASSWORD=1"
db=client.containers.run(img,command=arangocommand)
---------------------------------------------------------------------------
ContainerError Traceback (most recent call last)
<ipython-input-31-c5425f08f615> in <module>
1 arangocommand="-e ARANGO_RANDOM_ROOT_PASSWORD=1"
2
----> 3 db=client.containers.run(img,command=arangocommand)
~/anaconda3/envs/dockerdb/lib/python3.7/site-packages/docker/models/containers.py in run(self, image, command, stdout, stderr, remove, **kwargs)
793 if exit_status != 0:
794 raise ContainerError(
--> 795 container, exit_status, command, image, out
796 )
797
ContainerError: Command '-e ARANGO_RANDOM_ROOT_PASSWORD=1' in image 'sha256:d41deeeb6f1189a07e3e567bd104c82b53350b67eaadbe044fae9c1158cd8c1c' returned non-zero exit status 1: b'error: database is uninitialized and password option is not specified \n You need to specify one of ARANGO_ROOT_PASSWORD, ARANGO_NO_AUTH and ARANGO_RANDOM_ROOT_PASSWORD\n
'
Looking for a simple and robust way to connect to ArangoDB in a Docker container from Python. How can I then continue using ArangoDB Docker from Python without having to think about that it is running in a Docker container. IE
import dockerpy
then continuing to use only the dockerpy library