You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/04/27 10:53:31 UTC

[GitHub] [druid] FrankChen021 opened a new pull request #11167: Fix permission problem when creating dirs

FrankChen021 opened a new pull request #11167:
URL: https://github.com/apache/druid/pull/11167


   
   Fixes #11166  , See description in that issue for more info.
   
   
   This PR has:
   - [X] been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [X] been tested in a test Druid cluster.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] pchang388 commented on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
pchang388 commented on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-840632389


   > Hi @pchang388 the `/opt/druid` under source directory is actually a symlink, and the COPY command replaces the target `/opt/druid` directory by this symbolic link. Since there's no `var` directory in source directory, COPY command could not copy `var` to the target.
   
   Hi @FrankChen021 - thanks I took a look back at your explanation here: #11166 
   
   Essentially: 
   
   1. There is no var/ directory in the /opt from builder
   2. Even though we created earlier in the "mkdir -p " step - we are overwriting the entire /opt directory from builder
   3. This means var/ disappears since we did a full overwrite of the /opt directory
   4. Then uses "VOLUME /opt/druid/var" - which prepares the fs for mounting to external volume
   5. Since there is no longer a var/, Docker creates it using user id of the person running the build command in this case appears to be root


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] pchang388 edited a comment on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
pchang388 edited a comment on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-840632389


   > Hi @pchang388 the `/opt/druid` under source directory is actually a symlink, and the COPY command replaces the target `/opt/druid` directory by this symbolic link. Since there's no `var` directory in source directory, COPY command could not copy `var` to the target.
   
   Hi @FrankChen021 - thanks I took a look back at your explanation here: #11166 
   
   Essentially: 
   
   1. There is no var/ directory in the /opt from builder
   2. Even though we created earlier in the "mkdir -p " step - we are overwriting the entire /opt directory from builder
   3. This means var/ disappears since we did a full overwrite of the /opt directory
   4. Then uses "VOLUME /opt/druid/var" - which prepares the fs for mounting to external volume
   5. Since there is no longer a var/, Docker creates it using user id of the person running the build command in this case appears to be root
   
   Makes sense and appreciate you taking the time to help me understand.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] xvrl commented on a change in pull request #11167: Fix permission problem when creating dirs

Posted by GitBox <gi...@apache.org>.
xvrl commented on a change in pull request #11167:
URL: https://github.com/apache/druid/pull/11167#discussion_r622393236



##########
File path: distribution/docker/Dockerfile
##########
@@ -47,12 +47,13 @@ RUN ["/busybox/busybox", "--install", "/bin"]
 
 RUN addgroup -S -g 1000 druid \
  && adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
- && mkdir -p /opt/druid/var \
- && chown -R druid:druid /opt \
- && chmod 775 /opt/druid/var
+ && mkdir -p /opt
 
 COPY --chown=druid:druid --from=builder /opt /opt
 COPY distribution/docker/druid.sh /druid.sh
+RUN mkdir -p /opt/druid/var \

Review 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 create the symlink.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] xvrl commented on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
xvrl commented on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-830186657


   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on a change in pull request #11167: Fix permission problem when creating dirs

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on a change in pull request #11167:
URL: https://github.com/apache/druid/pull/11167#discussion_r622772989



##########
File path: distribution/docker/Dockerfile
##########
@@ -47,12 +47,13 @@ RUN ["/busybox/busybox", "--install", "/bin"]
 
 RUN addgroup -S -g 1000 druid \
  && adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
- && mkdir -p /opt/druid/var \
- && chown -R druid:druid /opt \
- && chmod 775 /opt/druid/var
+ && mkdir -p /opt

Review comment:
       fixed

##########
File path: distribution/docker/Dockerfile
##########
@@ -47,12 +47,13 @@ RUN ["/busybox/busybox", "--install", "/bin"]
 
 RUN addgroup -S -g 1000 druid \
  && adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
- && mkdir -p /opt/druid/var \
- && chown -R druid:druid /opt \
- && chmod 775 /opt/druid/var
+ && mkdir -p /opt
 
 COPY --chown=druid:druid --from=builder /opt /opt
 COPY distribution/docker/druid.sh /druid.sh
+RUN mkdir -p /opt/druid/var \

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] pchang388 edited a comment on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
pchang388 edited a comment on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-840120392


   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?
   
   ```/opt/apache-druid-0.21.0 $ ls -lrt
   total 228
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:13 licenses
   -rw-r--r--    1 druid    druid        71187 Apr 26 17:28 NOTICE
   -rw-r--r--    1 druid    druid        70924 Apr 26 17:28 LICENSE
   -rw-r--r--    1 druid    druid         8228 Apr 26 17:28 README
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 hadoop-dependencies
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 extensions
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 quickstart
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 conf
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 bin
   drwxr-xr-x    1 druid    druid        16384 Apr 26 17:32 lib
   drwxr-xr-x    2 root     root          4096 May 12 20:55 var
   ```
   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-830709243


   @frankiengkw there is a [workaround](https://github.com/apache/druid/releases) you could try


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] xvrl commented on a change in pull request #11167: Fix permission problem when creating dirs

Posted by GitBox <gi...@apache.org>.
xvrl commented on a change in pull request #11167:
URL: https://github.com/apache/druid/pull/11167#discussion_r622393236



##########
File path: distribution/docker/Dockerfile
##########
@@ -47,12 +47,13 @@ RUN ["/busybox/busybox", "--install", "/bin"]
 
 RUN addgroup -S -g 1000 druid \
  && adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
- && mkdir -p /opt/druid/var \
- && chown -R druid:druid /opt \
- && chmod 775 /opt/druid/var
+ && mkdir -p /opt
 
 COPY --chown=druid:druid --from=builder /opt /opt
 COPY distribution/docker/druid.sh /druid.sh
+RUN mkdir -p /opt/druid/var \

Review 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.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on pull request #11167: fix docker volume permission

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-829749638


   Thanks for reminding, I forgot that. I've updated the Dockerfile for java11 in the new commit.
   And the change of Dockerfile for java8 have been verified on my linux server.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on a change in pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on a change in pull request #11167:
URL: https://github.com/apache/druid/pull/11167#discussion_r636720247



##########
File path: distribution/docker/Dockerfile
##########
@@ -47,12 +47,13 @@ RUN ["/busybox/busybox", "--install", "/bin"]
 
 RUN addgroup -S -g 1000 druid \
  && adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
- && mkdir -p /opt/druid/var \
- && chown -R druid:druid /opt \
- && chmod 775 /opt/druid/var
+ && mkdir -p /opt
 
 COPY --chown=druid:druid --from=builder /opt /opt
 COPY distribution/docker/druid.sh /druid.sh
+RUN mkdir -p /opt/druid/var \

Review 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.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] frankiengkw commented on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
frankiengkw commented on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-830686649


   @jihoonson @FrankChen021 I faced this permission issue in my newly setup Druid.  Where can I download the latest fix/patch? Thanks. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
jihoonson commented on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-830189336


   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] xvrl commented on a change in pull request #11167: Fix permission problem when creating dirs

Posted by GitBox <gi...@apache.org>.
xvrl commented on a change in pull request #11167:
URL: https://github.com/apache/druid/pull/11167#discussion_r622393851



##########
File path: distribution/docker/Dockerfile
##########
@@ -47,12 +47,13 @@ RUN ["/busybox/busybox", "--install", "/bin"]
 
 RUN addgroup -S -g 1000 druid \
  && adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
- && mkdir -p /opt/druid/var \
- && chown -R druid:druid /opt \
- && chmod 775 /opt/druid/var
+ && mkdir -p /opt
 
 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 \

Review comment:
       no need for `-R` here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on a change in pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
clintropolis commented on a change in pull request #11167:
URL: https://github.com/apache/druid/pull/11167#discussion_r636696197



##########
File path: distribution/docker/Dockerfile
##########
@@ -47,12 +47,13 @@ RUN ["/busybox/busybox", "--install", "/bin"]
 
 RUN addgroup -S -g 1000 druid \
  && adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
- && mkdir -p /opt/druid/var \
- && chown -R druid:druid /opt \
- && chmod 775 /opt/druid/var
+ && mkdir -p /opt
 
 COPY --chown=druid:druid --from=builder /opt /opt
 COPY distribution/docker/druid.sh /druid.sh
+RUN mkdir -p /opt/druid/var \

Review 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?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] xvrl merged pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
xvrl merged pull request #11167:
URL: https://github.com/apache/druid/pull/11167


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on a change in pull request #11167: Fix permission problem when creating dirs

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on a change in pull request #11167:
URL: https://github.com/apache/druid/pull/11167#discussion_r622773398



##########
File path: distribution/docker/Dockerfile
##########
@@ -47,12 +47,13 @@ RUN ["/busybox/busybox", "--install", "/bin"]
 
 RUN addgroup -S -g 1000 druid \
  && adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
- && mkdir -p /opt/druid/var \
- && chown -R druid:druid /opt \
- && chmod 775 /opt/druid/var
+ && mkdir -p /opt
 
 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 \

Review comment:
       Yes, there's no sub-dirs under /opt/druid/var, `-R` is unnecessary. Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-830576774


   @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. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-840380751


   Hi @pchang388 the `/opt/druid` under source directory is actually a symlink, and the COPY command replaces the target `/opt/druid` directory by this symbolic link. Since there's no `var` directory in source directory, COPY command could not copy `var` to the target.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] pchang388 edited a comment on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
pchang388 edited a comment on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-840120392


   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?
   
   ```/opt/apache-druid-0.21.0 $ ls -lrt
   total 228
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:13 licenses
   -rw-r--r--    1 druid    druid        71187 Apr 26 17:28 NOTICE
   -rw-r--r--    1 druid    druid        70924 Apr 26 17:28 LICENSE
   -rw-r--r--    1 druid    druid         8228 Apr 26 17:28 README
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 hadoop-dependencies
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 extensions
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 quickstart
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 conf
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 bin
   drwxr-xr-x    1 druid    druid        16384 Apr 26 17:32 lib
   drwxr-xr-x    2 root     root          4096 May 12 20:55 var
   ```
   From what I've read it should have applied the user/group permissions recursively as it copied into /opt
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] pchang388 edited a comment on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
pchang388 edited a comment on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-840632389


   > Hi @pchang388 the `/opt/druid` under source directory is actually a symlink, and the COPY command replaces the target `/opt/druid` directory by this symbolic link. Since there's no `var` directory in source directory, COPY command could not copy `var` to the target.
   
   Hi @FrankChen021 - thanks I took a look back at your explanation here: #11166 
   
   Essentially: 
   
   1. There is no var/ directory in the /opt/druid from builder
   2. Even though we created earlier in the "mkdir -p " step - we are overwriting the entire /opt directory from builder
   3. This means var/ disappears since we did a full overwrite of the /opt directory
   4. Then uses "VOLUME /opt/druid/var" - which prepares the fs for mounting to external volume
   5. Since there is no longer a var/, Docker creates it using user id of the person running the build command in this case appears to be root
   
   Makes sense and appreciate you taking the time to help me understand.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] pchang388 commented on pull request #11167: fix docker volume permissions

Posted by GitBox <gi...@apache.org>.
pchang388 commented on pull request #11167:
URL: https://github.com/apache/druid/pull/11167#issuecomment-840120392


   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?
   
   `/opt/apache-druid-0.21.0 $ ls -lrt
   total 228
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:13 licenses
   -rw-r--r--    1 druid    druid        71187 Apr 26 17:28 NOTICE
   -rw-r--r--    1 druid    druid        70924 Apr 26 17:28 LICENSE
   -rw-r--r--    1 druid    druid         8228 Apr 26 17:28 README
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 hadoop-dependencies
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 extensions
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 quickstart
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 conf
   drwxr-xr-x    1 druid    druid         4096 Apr 26 17:32 bin
   drwxr-xr-x    1 druid    druid        16384 Apr 26 17:32 lib
   drwxr-xr-x    2 root     root          4096 May 12 20:55 var
   `
   From what I've read it should have applied the user/group permissions recursively as it copied into /opt
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] xvrl commented on a change in pull request #11167: Fix permission problem when creating dirs

Posted by GitBox <gi...@apache.org>.
xvrl commented on a change in pull request #11167:
URL: https://github.com/apache/druid/pull/11167#discussion_r622389540



##########
File path: distribution/docker/Dockerfile
##########
@@ -47,12 +47,13 @@ RUN ["/busybox/busybox", "--install", "/bin"]
 
 RUN addgroup -S -g 1000 druid \
  && adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
- && mkdir -p /opt/druid/var \
- && chown -R druid:druid /opt \
- && chmod 775 /opt/druid/var
+ && mkdir -p /opt

Review comment:
       I don't think creating `/opt` is necessary, the COPY will take care of it




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org