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 12m6s

This commit is contained in:
GianLuca Vagnuzzi
2026-01-02 08:22:08 +01:00
parent 347abc25b2
commit a9be070ff0
4 changed files with 48 additions and 19 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

@@ -24,4 +24,4 @@ RUN set -xe && \
ADD rootfs / ADD rootfs /
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["in.tftpd --ipv4 --foreground --listen --address 0.0.0.0:69 --create --secure -vvv /var/tftpboot"] CMD ["in.tftpd", "--ipv4", "--foreground", "--listen", "--address", "0.0.0.0:69", "--create", "--secure", "-vvv", "/var/tftpboot"]

View File

@@ -26,6 +26,9 @@ services:
restart: unless-stopped restart: unless-stopped
``` ```
## Changelog ## Changelog
v1.232.2-1 - 02.01.2026
- Defined CMD in Dockerfile; ENTRYPOINT now supports user-provided commands
v1.232.2 - 19.12.2025 v1.232.2 - 19.12.2025
- Alpine v. 3.23.2 - Alpine v. 3.23.2

View File

@@ -2,29 +2,53 @@
set -x set -x
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 set_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
} }
set_bashrc
CMD="$@" _dirs
[ -z "$CMD" ] && export CMD="supervisord -c /etc/supervisor/supervisord.conf" _main
exec $CMD setup_bashrc
# print cmd that will be executed
echo "Starting: $*" >&2
# launch CMD
exec "$@"
exit $?