You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/05/25 04:56:17 UTC

[GitHub] [pulsar] drianpauL opened a new pull request, #15769: [Fix][Docker] Add write permissions to /pulsar subdirectories to enable running as non-root user

drianpauL opened a new pull request, #15769:
URL: https://github.com/apache/pulsar/pull/15769

   Fixes #15230
   
   ### Motivation
   
   The Quickstart/[Getting Started in Docker](https://pulsar.apache.org/docs/next/getting-started-docker) example does not work with Pulsar 2.10.0:
   ```shell
   docker run -it -p 6650:6650  -p 8080:8080 --mount source=pulsardata,target=/pulsar/data --mount source=pulsarconf,target=/pulsar/conf apachepulsar/pulsar:2.10.0 bin/pulsar standalone
   ```
   When you run the command, you get a permissions error:
   ```
   ERROR org.apache.pulsar.PulsarStandaloneStarter - Failed to start pulsar service.
   java.nio.file.AccessDeniedException: /pulsar/data/standalone
   ```
   
   This is because the Docker image is running as a non-root user but does not have permissions to write to the volume being mounted at `/pulsar/data`
   
   I think this issue is an important concern because it frustrates prospective/new Pulsar users (like me!) with their first impression of trying the project
   
   ### Modifications
   - Previously the Docker image was adding write permissions (for the root group) to the `/pulsar/conf` directory
   - This PR updates that RUN instruction with a shell script loop that creates and sets write permissions on the following directories:
     - `/pulsar/conf`
     - `/pulsar/data`
     - `/pulsar/download`
     - `/pulsar/logs`
   
   ### Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   - It can be verified by running the Getting Started in Docker example code listed above, which currently fails with Pulsar 2.10.0
   
   ### Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API: no
     - The schema: no
     - The default values of configurations: no
     - The wire protocol: no
     - The rest endpoints: no
     - The admin cli options: no
     - Anything that affects deployment: yes
       - This PR updates the Docker image by creating empty, writeable subdirectories (`data`, `download`, `logs`) inside of `/pulsar` that did not previously exist to enable mounting of volumes that will be writeable by a non-root user at run-time. Potentially this may affect users who were relying on these directories not existing, however I'd contend that the image is broken for new users who are trying out Pulsar for the first time.
   
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   - [ ] `doc-required` 
   - [X] `no-need-doc` 
     - This PR fixes an issue that is already covered by existing "Getting Started in Docker" documentation, it does not require any updates to the existing documentation.
   - [ ] `doc` 
   - [ ] `doc-added`
   


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] drianpauL commented on pull request #15769: [Fix][Docker] Add write permissions to /pulsar subdirectories to enable running as non-root user

Posted by GitBox <gi...@apache.org>.
drianpauL commented on PR #15769:
URL: https://github.com/apache/pulsar/pull/15769#issuecomment-1138152804

   Thank you @michaeljmarshall for the prompt review and acceptance of this patch 🍰 


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] drianpauL commented on pull request #15769: [Fix][Docker] Add write permissions to /pulsar subdirectories to enable running as non-root user

Posted by GitBox <gi...@apache.org>.
drianpauL commented on PR #15769:
URL: https://github.com/apache/pulsar/pull/15769#issuecomment-1136726829

   This PR will also address #15746 which is effectively a duplicate of #15230


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michaeljmarshall merged pull request #15769: [Fix][Docker] Add write permissions to /pulsar subdirectories to enable running as non-root user

Posted by GitBox <gi...@apache.org>.
michaeljmarshall merged PR #15769:
URL: https://github.com/apache/pulsar/pull/15769


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] drianpauL commented on pull request #15769: [Fix][Docker] Add write permissions to /pulsar subdirectories to enable running as non-root user

Posted by GitBox <gi...@apache.org>.
drianpauL commented on PR #15769:
URL: https://github.com/apache/pulsar/pull/15769#issuecomment-1136727807

   cc @michaeljmarshall for your advice because of your work on #11269


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michaeljmarshall commented on pull request #15769: [Fix][Docker] Add write permissions to /pulsar subdirectories to enable running as non-root user

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on PR #15769:
URL: https://github.com/apache/pulsar/pull/15769#issuecomment-1136757327

   @drianpauL - thanks for your contribution! I should be able to review this tomorrow.


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michaeljmarshall commented on pull request #15769: [Fix][Docker] Add write permissions to /pulsar subdirectories to enable running as non-root user

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on PR #15769:
URL: https://github.com/apache/pulsar/pull/15769#issuecomment-1138137356

   Fixes #15647


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] benbro commented on pull request #15769: [Fix][Docker] Add write permissions to /pulsar subdirectories to enable running as non-root user

Posted by GitBox <gi...@apache.org>.
benbro commented on PR #15769:
URL: https://github.com/apache/pulsar/pull/15769#issuecomment-1149520793

   Is this fix released? I'm still getting errors.


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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