modified: src/Dockerfile

modified:   src/entrypoint.sh
	deleted:    src/update-ca.sh
This commit is contained in:
Rubén Castro Gutiérrez 2021-03-23 12:02:49 +00:00
parent a95d1bf44f
commit df9c72c9ce
3 changed files with 36 additions and 13 deletions

View File

@ -9,6 +9,6 @@ ENV XDG_CACHE_HOME=/cache
VOLUME ["/usr/local/share/ca-certificates"]
ENTRYPOINT ["./update-ca.sh"]
ENTRYPOINT ["./entrypoint.sh"]
CMD ["./entrypoint.sh"]
CMD []

View File

@ -1,11 +1,38 @@
#!/bin/sh
# Dump all env vars so we can source them in cron jobs
printenv | sed 's/^\(.*\)$/export \1/g' > /env.sh
set -e
# Write crontab
rcb crontab > crontab
setup_cacerts(){
# start cron in the foreground
crontab crontab
crond -f
update-ca-certificates
}
dump_env(){
# Dump all env vars so we can source them in cron jobs
printenv | sed 's/^\(.*\)$/export \1/g' > /env.sh
}
setup_crontab(){
# Write crontab
rcb crontab > crontab
# start cron in the foreground
crontab crontab
crond -f
}
start_app(){
setup_cacerts
if [ "$1" = '' ]; then
dump_env
setup_crontab
else
exec "$@"
fi
}
start_app "$@"

View File

@ -1,4 +0,0 @@
#!/bin/sh
# Update CA certificates
update-ca-certificates