Skip to content

Commit 3caa9f9

Browse files
committed
feat(docker): add script to echo deprecation warning conditionally e.g. for Dockerhub images
1 parent 99debd3 commit 3caa9f9

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ WORKDIR /app
5555

5656
ENV UWSGI_MODULE "giftless.wsgi_entrypoint"
5757

58-
ENTRYPOINT ["tini", "uwsgi", "--"]
59-
CMD ["-s", "127.0.0.1:5000", "-M", "-T", "--threads", "2", "-p", "2", \
58+
ARG IS_DOCKERHUB
59+
ENV IS_DOCKERHUB=$IS_DOCKERHUB
60+
61+
ENTRYPOINT ["scripts/docker-prerun.sh"]
62+
CMD ["tini", "uwsgi", "--", "-s", "127.0.0.1:5000", "-M", "-T", "--threads", "2", "-p", "2", \
6063
"--manage-script-name", "--callable", "app"]
6164

6265
# TODO remove this STOPSIGNAL override after uwsgi>=2.1

scripts/docker-prerun.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
# ANSI color codes
4+
RED='\033[1;31m'
5+
YELLOW='\033[1;33m'
6+
RESET='\033[0m'
7+
8+
if [ "$IS_DOCKERHUB" = true ]; then
9+
echo "${RED}**********************************************${RESET}"
10+
echo "${YELLOW}WARNING:${RESET} This Docker image from docker.io is deprecated!"
11+
echo "${YELLOW}It will no longer be maintained. Please use ghcr.io/datopian/giftless."
12+
echo "${YELLOW}Refer to https://github.com/datopian/giftless for more details."
13+
echo "${RED}**********************************************${RESET}"
14+
fi
15+
16+
exec "$@"

0 commit comments

Comments
 (0)