improve code for dockerfile (#253)

* improve code for dockerfile

* Update Dockerfile

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
houseme
2025-07-18 11:05:00 +08:00
committed by GitHub
parent 0167b2decd
commit fc8931d69f

View File

@@ -77,8 +77,6 @@ LABEL name="RustFS" \
# Install runtime dependencies
RUN apk add --no-cache \
ca-certificates \
curl \
tzdata \
bash \
&& addgroup -g 1000 rustfs \
&& adduser -u 1000 -G rustfs -s /bin/sh -D rustfs
@@ -89,7 +87,9 @@ ENV RUSTFS_ACCESS_KEY=rustfsadmin \
RUSTFS_ADDRESS=":9000" \
RUSTFS_CONSOLE_ENABLE=true \
RUSTFS_VOLUMES=/data \
RUST_LOG=warn
RUST_LOG=warn \
# Directory where RustFS stores observability logs. Ensure this path exists and has appropriate permissions.
RUSTFS_OBS_LOG_DIRECTORY=/logs
# Set permissions for /usr/bin (similar to MinIO's approach)
RUN chmod -R 755 /usr/bin
@@ -102,7 +102,7 @@ COPY --from=build /build/rustfs /usr/bin/
RUN chmod +x /usr/bin/rustfs
# Create data directory
RUN mkdir -p /data /config && chown -R rustfs:rustfs /data /config
RUN mkdir -p /data /logs && chown -R rustfs:rustfs /data /logs
# Switch to non-root user
USER rustfs