Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker-compose not executing scripts in /docker-entrypoint-initdb.d #48

Closed
wenshutang opened this issue May 23, 2018 · 8 comments
Closed

Comments

@wenshutang
Copy link

We run a few scripts inside /docker-entrypoint-initdb.d
When using docker to run the container, the scripts run fine:

$ docker run -it -p 8529:8529 -e ARANGO_NO_AUTH=1 my.registry.net/my-arangodb
automaticaly choosing storage engine
Initializing database...Hang on...
/entrypoint.sh: running /docker-entrypoint-initdb.d/1_init-objectstore-db.js
/entrypoint.sh: running /docker-entrypoint-initdb.d/2_deploy-foxx.js
Database initialized...Starting System...
2018-05-23T21:56:42Z [1] INFO ArangoDB 3.3.8 [linux] 64bit, using jemalloc, build tags/v3.3.8-0-g50ef880b25, VPack 0.1.30, RocksDB 5.6.0, ICU 58.1, V8 5.7.492.77, OpenSSL 1.1.0f  25 May 2017
2018-05-23T21:56:42Z [1] INFO {authentication} Jwt secret not specified, generating...
2018-05-23T21:56:42Z [1] INFO detected operating system: Linux version 4.9.87-linuxkit-aufs (root@70f48253c8b4) (gcc version 6.4.0 (Alpine 6.4.0) ) #1 SMP Fri Mar 16 18:16:33 UTC 2018
2018-05-23T21:56:42Z [1] INFO using storage engine mmfiles
2018-05-23T21:56:42Z [1] INFO {cluster} Starting up with role SINGLE

But when using docker-compose, the scripts are skipped

$ docker-compose up arangodb
Starting my-service_arangodb_1 ... done
Attaching to my-service_arangodb_1
arangodb_1              | automaticaly choosing storage engine
arangodb_1              | 2018-05-23T22:45:01Z [1] INFO ArangoDB 3.3.8 [linux] 64bit, using jemalloc, build tags/v3.3.8-0-g50ef880b25, VPack 0.1.30, RocksDB 5.6.0, ICU 58.1, V8 5.7.492.77, OpenSSL 1.1.0f  25 May 2017
arangodb_1              | 2018-05-23T22:45:01Z [1] INFO {authentication} Jwt secret not specified, generating...
arangodb_1              | 2018-05-23T22:45:01Z [1] INFO detected operating system: Linux version 4.9.87-linuxkit-aufs (root@70f48253c8b4) (gcc version 6.4.0 (Alpine 6.4.0) ) #1 SMP Fri Mar 16 18:16:33 UTC 2018
arangodb_1              | 2018-05-23T22:45:01Z [1] INFO using storage engine mmfiles
arangodb_1              | 2018-05-23T22:45:01Z [1] INFO {cluster} Starting up with role SINGLE
arangodb_1              | 2018-05-23T22:45:01Z [1] INFO {syscall} file-descriptors (nofiles) hard limit is 1048576, soft limit is 1048576
arangodb_1              | 2018-05-23T22:45:01Z [1] INFO {authentication} Authentication is turned off, authentication for unix sockets is turned on
arangodb_1              | 2018-05-23T22:45:01Z [1] WARNING {memory} /proc/sys/vm/overcommit_memory is set to '1'. It is recommended to set it to a value of 0 or 2
arangodb_1              | 2018-05-23T22:45:01Z [1] WARNING {memory} execute 'sudo bash -c "echo 2 > /proc/sys/vm/overcommit_memory"'
arangodb_1              | 2018-05-23T22:45:02Z [1] INFO using endpoint 'http+tcp://0.0.0.0:8529' for non-encrypted requests

Part of my compose file:

version: '3'
services:
  arangodb:
    build:
    image: my.registry.net/my-arangodb
    ports:
      - "8529:8529"
    environment:
      - ARANGO_NO_AUTH=1

Is there anything I am missing here? Why the inconsistency?

@dothebart
Copy link
Contributor

Hi,
we run https://github.com/arangodb/arangodb-docker/tree/official/test-user-scripts on each push of the docker container. Please have a look at them, whether they can serve as a working example for you.

@wenshutang
Copy link
Author

@dothebart Thank you for the information. The scripts I have run fine on an arangodb container, it's when I try to bring it up using docker-compose that I am having issues. The entrypoint.sh script doesn't seem to run at all, I don't even see these 2 lines:

Initializing database...Hang on...
Database initialized...Starting System...

@brendanwheble
Copy link

I had exactly the same problem using docker-compose. I removed all of my containers and images and then tried again, this time it imported my /dumps

@dothebart
Copy link
Contributor

could it be related to this comment? docker-library/postgres#203 (comment) (learned that from @rtmruczek )

@brendanwheble
Copy link

Yes, see my previous comment

@wenshutang
Copy link
Author

Yes @dothebart @brendanwheble, I believe this caused by persistence, much like the postgres issue

I believe this line in the docker entry file is the root cause. Try removing the file /var/lib/arangodb3/SERVER

@dothebart
Copy link
Contributor

ok, maybe #51 would then better help to see why no initialisation is done.

@dothebart
Copy link
Contributor

Ok, the current arangodb docker containers now contain these hints, will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants