Defined CMD in Dockerfile; ENTRYPOINT now supports user-provided commands
All checks were successful
Update Docker Hub Description / dockerHubDescription (push) Successful in 12s
Docker Image CI / build_docker_images (push) Successful in 13m51s

This commit is contained in:
GianLuca Vagnuzzi
2026-01-02 08:21:45 +01:00
parent 4ab10e6de7
commit 25229e748e
4 changed files with 47 additions and 25 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
.directory .directory
build.sh build.sh
deploy.sh deploy.sh
data
compose-test.yml

View File

@@ -23,9 +23,6 @@ RUN set -xe && \
ADD rootfs / ADD rootfs /
# Check Process Within The Container Is Healthy
#HEALTHCHECK --interval=60s --timeout=5s CMD chronyc tracking > /dev/null
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
#CMD ["/entrypoint.sh"] CMD ["/usr/sbin/minidlnad", "-S"]
#CMD ["chronyd","-d","-s" ]

View File

@@ -70,6 +70,9 @@ Type of media legend:
``` ```
## Changelog ## Changelog
v1.232.3-1 - 02.01.2026
- Defined CMD in Dockerfile; ENTRYPOINT now supports user-provided commands
v1.232.3 - 19.12.2025 v1.232.3 - 19.12.2025
- Alpine v. 3.23.2 - Alpine v. 3.23.2

View File

@@ -35,8 +35,6 @@ function _main {
[ -e /run/minidlna/minidlna.pid ] && rm /run/minidlna/minidlna.pid [ -e /run/minidlna/minidlna.pid ] && rm /run/minidlna/minidlna.pid
# define CMD to be launched
CMD="/usr/sbin/minidlnad -S"
} }
function _dirs { function _dirs {
@@ -68,31 +66,53 @@ if [ ! -z $outListDirs ]; then
fi fi
} }
function custom_bashrc { custom_bashrc() {
echo ' cat <<'EOF'
export LS_OPTIONS="--color=auto" export LS_OPTIONS="--color=auto"
alias "ls=ls $LS_OPTIONS" alias ls='ls $LS_OPTIONS'
alias "ll=ls $LS_OPTIONS -la" alias ll='ls $LS_OPTIONS -la'
alias "l=ls $LS_OPTIONS -lA" alias l='ls $LS_OPTIONS -lA'
'
# prompt SOLO per shell interattive
if [[ $- == *i* ]]; then
if [ "$(id -u)" -eq 0 ]; then
PS1="\[\e[35m\][\[\e[31m\]\u\[\e[36m\]@\[\e[32m\]\h\[\e[90m\] \w\[\e[35m\]]\[\e[0m\]# "
else
PS1="\[\e[35m\][\[\e[33m\]\u\[\e[36m\]@\[\e[32m\]\h\[\e[90m\] \w\[\e[35m\]]\[\e[0m\]$ "
fi
export PS1
fi
EOF
} }
function _bashrc { setup_bashrc() {
echo "-----------------------------------------" for home in /root /home/*; do
echo " .bashrc file setup..." [ -d "$home" ] || continue
echo "-----------------------------------------" bashrc="$home/.bashrc"
custom_bashrc | tee /root/.bashrc
echo 'export PS1="\[\e[35m\][\[\e[31m\]\u\[\e[36m\]@\[\e[32m\]\h\[\e[90m\] \w\[\e[35m\]]\[\e[0m\]# "' >> /root/.bashrc # crea se manca
for i in $(ls /home); do echo 'export PS1="\[\e[35m\][\[\e[33m\]\u\[\e[36m\]@\[\e[32m\]\h\[\e[90m\] \w\[\e[35m\]]\[\e[0m\]$ "' >> /home/${i}/.bashrc; done [ -f "$bashrc" ] || touch "$bashrc"
# evita duplicazioni
grep -q '### CUSTOM BASHRC ###' "$bashrc" && continue
{
echo ''
echo '### CUSTOM BASHRC ###'
custom_bashrc
} >> "$bashrc"
done
} }
_dirs _dirs
_main _main
_bashrc
#CMD="$@"
[ -z "$CMD" ] && export CMD="supervisord -c /etc/supervisor/supervisord.conf"
exec $CMD setup_bashrc
exit $? # print cmd that will be executed
echo "Starting: $*" >&2
# launch CMD
exec "$@"