From 66b6353960024d77b4861624d5349f2920ecaafb Mon Sep 17 00:00:00 2001 From: Nikolay Arhipov Date: Sun, 24 Sep 2023 15:11:18 +0300 Subject: [PATCH] Allow running protoc as a non-root user Previously `pub-cache` was located inside of `/root`, which made it inaccessible if this container is run with `-u` flag as a non-root user. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cc560ec..4161c5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,8 @@ COPY --from=protobuf /protoc/bin/protoc /bin/ COPY --from=protobuf /protoc/include /usr/local/include COPY --from=protobuf /protoc/readme.txt /protoc-readme.txt -ENV PATH="/root/.pub-cache/bin:$PATH" +ENV PUB_CACHE=/pub-cache +ENV PATH="/pub-cache/bin:$PATH" RUN dart pub global activate protoc_plugin $PROTOC_PLUGIN_VERSION COPY README.md /README.md