-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The -a parameter is missing from the software rust version #876
Comments
Why is that useful in container? It is just for switching user when starting process as a daemon. |
If the -a parameter is supported, you can use the startup script exec to run the daemon, and then use docker exec to replace the CMD parameter to enter the container when running the container. The current container cannot enter the container normally |
|
I know the docker On the contrary, if the program supports the use of a specific user, it can be pulled up with root privileges when running the container, and the user can operate normally after entering the container. |
When you execute the Such as:
|
Maybe because it sets Line 52 in a4955a1
|
Yes, but it is not directly related. Because the program does not support custom users, there is no way to use the script to pull up the main program. #!/bin/sh
# vim:sw=4:ts=4:et
set -e
if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then
exec 3>&1
else
exec 3>/dev/null
fi
if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in
*.sh)
if [ -x "$f" ]; then
echo >&3 "$0: Launching $f";
"$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*) echo >&3 "$0: Ignoring $f";;
esac
done
echo >&3 "$0: Configuration complete; ready for start up"
else
echo >&3 "$0: No files found in /docker-entrypoint.d/, skipping configuration"
fi
fi
exec "$@" Use command in Dockerfile ...
...
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 80
STOPSIGNAL SIGQUIT
CMD ["nginx", "-g", "daemon off;"] It can be understood that when the container is started, the Dockerfile CMD parameter will be spliced after the ENTRYPOINT (eg: It should be easier for you to understand this. |
In short, if you want to make a docker image that can be entered and can be launched by a low-privileged user, you need to implement a |
Such as libev version, can be used
-a nobody
to run the main program. Easier debugging in container environments. wish to implement this feature.The text was updated successfully, but these errors were encountered: