Defined CMD in Dockerfile; ENTRYPOINT now supports user-provided commands
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
build.sh
|
build.sh
|
||||||
deploy.sh
|
deploy.sh
|
||||||
data
|
data
|
||||||
|
compose-test.yml
|
||||||
|
|||||||
@@ -33,4 +33,4 @@ RUN set -xe && \
|
|||||||
ADD rootfs /
|
ADD rootfs /
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
#CMD ["/usr/sbin/dhcpd -4 -f -d --no-pid -cf /etc/dhcp/dhcpd.conf -lf /etc/dhcp/dhcpd.leases -user dhcpd -group dhcpd"]
|
CMD ["/usr/sbin/named", "-u", "bind", "-g", "-c", "/data/named.conf"]
|
||||||
|
|||||||
@@ -34,15 +34,22 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
```
|
```
|
||||||
## Changelog
|
## Changelog
|
||||||
|
v13.2.192015-2 - 02.01.2026
|
||||||
|
- Defined CMD in Dockerfile; ENTRYPOINT now supports user-provided commands
|
||||||
|
|
||||||
v13.2.192015-1 - 31.12.2025
|
v13.2.192015-1 - 31.12.2025
|
||||||
- Debian v. 13.2
|
- Debian v. 13.2
|
||||||
|
|
||||||
v.2.1.0 - 27.10.2025
|
v.2.1.0 - 27.10.2025
|
||||||
- bind9 v. 1:9.20.15-1
|
- bind9 v. 1:9.20.15-1
|
||||||
|
|
||||||
v.2.0.1 - 08.10.2025
|
v.2.0.1 - 08.10.2025
|
||||||
- Set env for Bind version in Dockerfile.
|
- Set env for Bind version in Dockerfile.
|
||||||
|
|
||||||
v.2.0.0 - 09.09.2025
|
v.2.0.0 - 09.09.2025
|
||||||
- Debian v. 13.1
|
- Debian v. 13.1
|
||||||
- bind9 v. 1:9.20.11-4
|
- bind9 v. 1:9.20.11-4
|
||||||
|
|
||||||
v.1.0.0 - 25.06.2025
|
v.1.0.0 - 25.06.2025
|
||||||
- Debian v. 12.11
|
- Debian v. 12.11
|
||||||
- bind9 v. 1:9.18.33-1~deb12u2
|
- bind9 v. 1:9.18.33-1~deb12u2
|
||||||
|
|||||||
@@ -48,34 +48,57 @@ function _main {
|
|||||||
|
|
||||||
chown -R 100:100 /data
|
chown -R 100:100 /data
|
||||||
# define CMD to be launched
|
# define CMD to be launched
|
||||||
CMD="/usr/sbin/named -u bind -g -c /data/named.conf"
|
#CMD="/usr/sbin/named -u bind -g -c /data/named.conf"
|
||||||
}
|
}
|
||||||
|
|
||||||
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="$@"
|
setup_bashrc
|
||||||
[ -z "$CMD" ] && export CMD="supervisord -c /etc/supervisor/supervisord.conf"
|
|
||||||
|
# print cmd that will be executed
|
||||||
|
echo "Starting: $*" >&2
|
||||||
|
|
||||||
|
# launch CMD
|
||||||
|
exec "$@"
|
||||||
|
|
||||||
exec $CMD
|
|
||||||
|
|
||||||
exit $?
|
|
||||||
|
|||||||
Reference in New Issue
Block a user