mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-21 03:46:37 +00:00
add non root user support for container deployment (#817)
This commit is contained in:
+8
-1
@@ -64,8 +64,12 @@ COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|||||||
COPY --from=build /build/rustfs /usr/bin/rustfs
|
COPY --from=build /build/rustfs /usr/bin/rustfs
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
RUN chmod +x /usr/bin/rustfs /entrypoint.sh && \
|
RUN chmod +x /usr/bin/rustfs /entrypoint.sh
|
||||||
|
|
||||||
|
RUN addgroup -g 1000 -S rustfs && \
|
||||||
|
adduser -u 1000 -G rustfs -S rustfs -D && \
|
||||||
mkdir -p /data /logs && \
|
mkdir -p /data /logs && \
|
||||||
|
chown -R rustfs:rustfs /data /logs && \
|
||||||
chmod 0750 /data /logs
|
chmod 0750 /data /logs
|
||||||
|
|
||||||
ENV RUSTFS_ADDRESS=":9000" \
|
ENV RUSTFS_ADDRESS=":9000" \
|
||||||
@@ -82,8 +86,11 @@ ENV RUSTFS_ADDRESS=":9000" \
|
|||||||
RUSTFS_SINKS_FILE_PATH="/logs"
|
RUSTFS_SINKS_FILE_PATH="/logs"
|
||||||
|
|
||||||
EXPOSE 9000 9001
|
EXPOSE 9000 9001
|
||||||
|
|
||||||
VOLUME ["/data", "/logs"]
|
VOLUME ["/data", "/logs"]
|
||||||
|
|
||||||
|
USER rustfs
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
CMD ["rustfs"]
|
CMD ["rustfs"]
|
||||||
|
|||||||
Reference in New Issue
Block a user