Skip to content

Commit f2d12cd

Browse files
authored
Merge pull request #214 from mozilla-services/fix-docker-image
fix: make entrypoint.sh work as expected
2 parents 4399873 + 26e512e commit f2d12cd

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

Diff for: Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ RUN python -m pip install --no-cache-dir -r requirements.txt
2020
# Copy the rest of the application code
2121
COPY --chown=app:app . .
2222

23-
CMD ["sh", "enrypoint.sh"]
23+
ENTRYPOINT ["/app/entrypoint.sh"]
24+
CMD ["run"]

Diff for: entrypoint.sh

100644100755
+30-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1-
# Build and publish the tracking lists for safebrowsing and webkit
2-
python lists2safebrowsing.py
3-
python lists2webkit.py
1+
#!/usr/bin/env bash
2+
3+
_usage() {
4+
cat <<EOF
5+
usage: ${0} [run]
6+
7+
arguments:
8+
run main entrypoint, execute shavar list creation scripts and exit
9+
10+
EOF
11+
}
12+
13+
if [[ "${#}" -gt 0 ]]; then
14+
CMD=${1} && shift
15+
16+
case "${CMD}" in
17+
run)
18+
python lists2safebrowsing.py
19+
python lists2webkit.py
20+
;;
21+
22+
*)
23+
echo "ERROR: unknown command: \"${CMD}\""
24+
_usage && exit 1
25+
;;
26+
esac
27+
28+
else
29+
_usage && exit
30+
fi

0 commit comments

Comments
 (0)