Conversation
| && mkdir -p /opt/druid/var \ | ||
| && chown -R druid:druid /opt \ | ||
| && chmod 775 /opt/druid/var | ||
| && mkdir -p /opt |
There was a problem hiding this comment.
I don't think creating /opt is necessary, the COPY will take care of it
|
|
||
| COPY --chown=druid:druid --from=builder /opt /opt | ||
| COPY distribution/docker/druid.sh /druid.sh | ||
| RUN mkdir -p /opt/druid/var \ |
There was a problem hiding this comment.
nit, I would remove the -p to ensure /opt/druid exists and symlinks to a valid directory. When I did some testing, I realized that Docker for Mac gets confused when COPYing from the builder stage if /opt/druid is already created beforehand as a directory, causing it to fail to copy the symlink.
There was a problem hiding this comment.
Not sure this is the appropriate place for this question since this has been like it since the dockerfile was added afaict, but what is the reason for using the symlink for /opt/druid? Based on some comments around this issue/PR, and also looking at #11278, it seems to cause issues in some situations, so is it actually necessary for some reason or have some benefit?
There was a problem hiding this comment.
I checked the history of this file, the first commit used symlink there. I have no idea why symlink is used.
I guess:
The name of raw directory contains a version variable whose value is retrieve by executing maven command against the source directory, while the value of this version variable could not be accessed in the following stage.
| COPY --chown=druid:druid --from=builder /opt /opt | ||
| COPY distribution/docker/druid.sh /druid.sh | ||
| RUN mkdir -p /opt/druid/var \ | ||
| && chown -R druid:druid /opt/druid/var \ |
There was a problem hiding this comment.
Yes, there's no sub-dirs under /opt/druid/var, -R is unnecessary. Fixed
xvrl
left a comment
There was a problem hiding this comment.
LGTM, assuming the docker build has been tested.
xvrl
left a comment
There was a problem hiding this comment.
@FrankChen021 I just realized we also need to update Dockerfile.java11, can you please make the same changes there? Thanks!
this backports apache#11167 to our 0.21.0 branch
Signed-off-by: frank chen <frank.chen021@outlook.com>
|
Thanks for reminding, I forgot that. I've updated the Dockerfile for java11 in the new commit. |
|
FYI @FrankChen021 I'm going to merge this. I manually tested the docker build and verified it runs, since we don't have an integration test for this. |
|
LGTM. Thanks @FrankChen021 @xvrl. @FrankChen021 Travis CI runs for both branches and PRs on this repo. Please create a branch on your fork next time, so that we don't waste our CI resources. |
|
@jihoonson Thanks for reminding, I would follow your suggestion. I thought the branch was created on my fork when I edit the file directly on github, but it didn't. |
|
@jihoonson @FrankChen021 I faced this permission issue in my newly setup Druid. Where can I download the latest fix/patch? Thanks. |
|
@frankiengkw there is a workaround you could try |
Docker volume directory was accidentally removed due to reordering of statements. This causes ownership and permissions on the volume directory to be reset, preventing startup. fixes #11166 Signed-off-by: frank chen <frank.chen021@outlook.com>
|
We ran into this issue when trying to set things up. Sorry to bother, but could someone help me understand why "COPY --chown" did not work as expected? From what I've read it should have applied the user/group permissions recursively as it copied into "/opt". Just trying to understand the issue better. |
|
Hi @pchang388 the |
Hi @FrankChen021 - thanks I took a look back at your explanation here: #11166 Essentially:
Makes sense and appreciate you taking the time to help me understand. |
Fixes #11166 , See description in that issue for more info.
This PR has: