-
Notifications
You must be signed in to change notification settings - Fork 344
invalid line return character in docker-entrypoint.sh prevents from using a data volume #35
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
Comments
@bcopy follow-up |
This seems OK in master: elasticsearch/docker-entrypoint.sh Lines 10 to 15 in 50a531d
I've even done a $ hexdump -C docker-entrypoint.sh
...
000000b0 68 0a 69 66 20 5b 20 22 24 31 22 20 3d 20 27 65 |h.if [ "$1" = 'e|
000000c0 6c 61 73 74 69 63 73 65 61 72 63 68 27 20 5d 3b |lasticsearch' ];|
000000d0 20 74 68 65 6e 0a 09 23 20 43 68 61 6e 67 65 20 | then..# Change |
000000e0 74 68 65 20 6f 77 6e 65 72 73 68 69 70 20 6f 66 |the ownership of|
000000f0 20 2f 75 73 72 2f 73 68 61 72 65 2f 65 6c 61 73 | /usr/share/elas|
00000100 74 69 63 73 65 61 72 63 68 2f 64 61 74 61 20 74 |ticsearch/data t|
00000110 6f 20 65 6c 61 73 74 69 63 73 65 61 72 63 68 0a |o elasticsearch.|
00000120 09 63 68 6f 77 6e 20 2d 52 20 65 6c 61 73 74 69 |.chown -R elasti|
00000130 63 73 65 61 72 63 68 3a 65 6c 61 73 74 69 63 73 |csearch:elastics|
00000140 65 61 72 63 68 20 2f 75 73 72 2f 73 68 61 72 65 |earch /usr/share|
00000150 2f 65 6c 61 73 74 69 63 73 65 61 72 63 68 2f 64 |/elasticsearch/d|
00000160 61 74 61 0a 09 65 78 65 63 20 67 6f 73 75 20 65 |ata..exec gosu e|
... (ie, no Also seems to be doing the right thing in the latest image pulled from the Hub: $ docker pull elasticsearch
latest: Pulling from elasticsearch
25963d635584: Pulling fs layer
19cf57dd894c: Pull complete
e51ff1b5ec40: Pull complete
587230b660b9: Pull complete
167b602a607c: Pull complete
0f8f6d06d6e2: Pull complete
6994f8c11459: Pull complete
fd16a44f4a07: Pull complete
ee50ebc4c64f: Pull complete
2354a20bfae0: Pull complete
85528d878da2: Pull complete
5a2a13378f3e: Pull complete
44906177d2f4: Pull complete
e833cbfd6f51: Pull complete
3b5841cb4066: Pull complete
b984041933ed: Pull complete
06a76d26b387: Pull complete
e54fcaa9f4d8: Pull complete
4f01161d4b95: Pull complete
a48fbc66fbbf: Pull complete
66f517e19c0f: Pull complete
38c06f9801d0: Already exists
61b3964dfa70: Already exists
f5224fc54ad2: Already exists
elasticsearch:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:5f49f6aee64d80d6be2faee90800c351c5e9da2bb0c5e6cf7725e741315bc06e
Status: Downloaded newer image for elasticsearch:latest
$ docker run -it --rm elasticsearch bash
root@1d9d7fa576ac:/# bash -x /docker-entrypoint.sh elasticsearch --help
+ set -e
+ '[' e = - ']'
+ '[' elasticsearch = elasticsearch ']'
+ chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data
+ exec gosu elasticsearch elasticsearch --help
Usage: /usr/share/elasticsearch/bin/elasticsearch [-vdh] [-p pidfile] [-D prop] [-X prop]
Start elasticsearch.
-d daemonize (run in background)
-p pidfile write PID to <pidfile>
-h
--help print command line options
-v print elasticsearch version, then exit
-D prop set JAVA system property
-X prop set non-standard JAVA system property
--prop=val
--prop val set elasticsearch property (i.e. -Des.<prop>=<val>)
root@1d9d7fa576ac:/# |
This is caused by selinux on the docker host. (esp. RHEL7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Linked to #5 and #6, it would appear that the docker-entrypoint.sh contains an invalid line return, which comments out the "chown" command, and fails the startup.
Test case to reproduce the problem :
Note that you will get :
If you inspect the docker-entrypoint.sh, you will see that the "chown" command is commented out like so :
docker exec -ti es cat /docker-entrypoint.sh
You will get this extract as part of the file :
Note that the chown is commented out. If you uncomment it on a new line, everything works fine.
Please confirm whether this is a bug.
The text was updated successfully, but these errors were encountered: