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 13m24s

This commit is contained in:
GianLuca Vagnuzzi
2026-01-02 08:22:01 +01:00
parent b1ee62110b
commit 6f0de40ec3
4 changed files with 48 additions and 18 deletions

2
.gitignore vendored
View File

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

View File

@@ -25,3 +25,4 @@ RUN set -xe && \
ADD rootfs / ADD rootfs /
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["smbd", "-F", "--no-process-group", "--debug-stdout", "-d", "3", "--configfile=/data/smb.conf"]

View File

@@ -50,6 +50,9 @@ services:
``` ```
## Changelog ## Changelog
v1.232.22-2 - 02.01.2026
- Defined CMD in Dockerfile; ENTRYPOINT now supports user-provided commands
v1.232.22-1 - 31.12.2025 v1.232.22-1 - 31.12.2025
- Modified cmd in entrypoint file for more log - Modified cmd in entrypoint file for more log

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
set -x set -e
[ ! -d /data ] && mkdir /data [ ! -d /data ] && mkdir /data
@@ -71,24 +71,48 @@ if [ -e /tmp/groups.db ]; then
done done
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
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
}
_bashrc
#smbd -F -d 2 --configfile=/data/smb.conf # crea se manca
smbd -F --debug-stdout -d 3 --configfile=/data/smb.conf [ -f "$bashrc" ] || touch "$bashrc"
# evita duplicazioni
grep -q '### CUSTOM BASHRC ###' "$bashrc" && continue
{
echo ''
echo '### CUSTOM BASHRC ###'
custom_bashrc
} >> "$bashrc"
done
}
setup_bashrc
# print cmd that will be executed
echo "Starting: $*" >&2
# launch CMD
exec "$@"