mukesh154 opened a new pull request, #22441:
URL: https://github.com/apache/pulsar/pull/22441
### Motivation
The pulsar-shell is not getting started on default `pulsar` user (a non-root
user). However, it is woking with `root` user.
After exec into the docker container if you try to run the pulsar-shell, you
get a permissions error:
```
$ ./bin/pulsar-shell
Exception in thread "main" java.nio.file.AccessDeniedException: /home/pulsar
at
java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at
java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:397)
at java.base/java.nio.file.Files.createDirectory(Files.java:700)
at
java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)
at java.base/java.nio.file.Files.createDirectories(Files.java:793)
at org.apache.pulsar.shell.PulsarShell.<init>(PulsarShell.java:160)
at org.apache.pulsar.shell.PulsarShell.<init>(PulsarShell.java:142)
at org.apache.pulsar.shell.PulsarShell.main(PulsarShell.java:215)
```
This is because the Docker image is running as a non-root user `pulsar` but
does not have permissions to execute to the `./bin/pulsar-shell`
I think this issue is an important concern because it frustrates
prospective/new Pulsar users (like me!) with their first impression of trying
the pulsar-shell
### Modifications
- Previously the Docker image was adding write permissions (for the root
group) to few directories but not to `/pulsar/bin`.
- This PR updates that RUN instruction that creates and sets execute
permission on the bin directory:
- `/pulsar/bin`
### Verifying this change
This change is a rework/code-cleanup without any test coverage.
### 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]