Run with Root User Privilegesยถ
Flower Docker images, by default, run with a non-root user (username/groupname: app
,
UID/GID: 49999
). Using root user is not recommended unless it is necessary for
specific tasks during the build process.
Always make sure to run the container as a non-root user in production to maintain security best practices.
Run a Container with Root User Privilegesยถ
-u
ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ Docker ์ด๋ฏธ์ง๋ฅผ ์คํํ๊ณ ์ฌ์ฉ์ ์ด๋ฆ์ผ๋ก ``root``๋ฅผ ์ง์ ํฉ๋๋ค:
$ docker run --rm -u root flwr/superlink:1.15.2 <additional-args>
์ด ๋ช ๋ น์ ๋ฃจํธ ์ฌ์ฉ์ ๊ถํ์ผ๋ก Docker ์ปจํ ์ด๋๋ฅผ ์คํํฉ๋๋ค.
Run the Build Process with Root User Privilegesยถ
Docker ์ด๋ฏธ์ง ๋น๋ ๊ณผ์ ์์ ๋ฃจํธ ์ฌ์ฉ์๋ก ์ ํํ์ฌ ๋๋ฝ๋ ์์คํ
์์กด์ฑ์ ์ค์นํ๋ ค๋ฉด Dockerfile ๋ด์์ USER root
์ง์์ด๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
SuperNode Dockerfileยถ
FROM flwr/supernode:1.15.2
# Switch to root user
USER root
# Install missing dependencies (requires root access)
RUN apt-get update && apt-get install -y <required-package-name>
# Switch back to non-root user app
USER app
# Continue with your Docker image build process
# ...