You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running protoc as root with the --kotlin_out option produces an error:
--kotlin_out: protoc-gen-kotlin: Plugin output is unparseable: \033[0;33mApplication
is running as root (UID 0). This is considered
insecure.\033[0m\nz\344w\n\031pbandk/google/api/http.ktz
This is because pbandk uses Spring Boot's launchScript feature in order to turn protoc-gen-kotlin.jar into a self-executable file. The default launch script used by Spring Boot prints a warning if run as root. This is mainly in place to prevent running Spring Boot jars as services under the root account. Since pbandk doesn't need the service-related functionality, we should probably replace the default Spring Boot launch script with a much-simplified custom version using something like:
Hi, I'm trying to add the protoc-gen-kotlin plugin to https://github.com/rvolosatovs/docker-protobuf (maybe this would resolve #224 for you?) and I'm running into this problem with the warning from Spring Boot about running as root. I'm trying to determine if it would be easier to make this change away from Spring Boot in pbandk, or if we should figure out how to adjust the container running the file to use an unprivileged user. Thoughts?
In general, using an unprivileged user is best practice for Docker containers. But I don't know if that would make the docker-protobuf container more difficult to use since it's main purpose is to read/write files outside of the container and doing that with non-root permissions could be more challenging.
I don't think the change on the pbandk side to make this work properly would be that difficult if you wanted to tackle it on the pbandk side. It involves:
Running
protoc
as root with the--kotlin_out
option produces an error:This is because pbandk uses Spring Boot's
launchScript
feature in order to turnprotoc-gen-kotlin.jar
into a self-executable file. The default launch script used by Spring Boot prints a warning if run as root. This is mainly in place to prevent running Spring Boot jars as services under the root account. Since pbandk doesn't need the service-related functionality, we should probably replace the default Spring Boot launch script with a much-simplified custom version using something like:The text was updated successfully, but these errors were encountered: