Update Dockerfile
Browse files- Dockerfile +17 -18
Dockerfile
CHANGED
@@ -10,29 +10,28 @@ RUN apt-get update && \
|
|
10 |
libxext6 \
|
11 |
fontconfig \
|
12 |
imagemagick \
|
13 |
-
ghostscript && \
|
14 |
# Modify ImageMagick policy to be less restrictive for TextClip
|
15 |
-
# This
|
16 |
-
#
|
17 |
-
#
|
18 |
-
#
|
19 |
-
# First, find the policy file path
|
20 |
( \
|
21 |
-
POLICY_FILE=$(find /etc/ImageMagick* -name policy.xml
|
22 |
-
if [ -f "$POLICY_FILE" ]; then \
|
23 |
echo "INFO: Modifying ImageMagick policy file: $POLICY_FILE"; \
|
24 |
-
sed -i 's/<policy domain="coder" rights="none" pattern="PS" \/>/<!--
|
25 |
-
sed -i 's/<policy domain="coder" rights="none" pattern="PS2" \/>/<!--
|
26 |
-
sed -i 's/<policy domain="coder" rights="none" pattern="PS3" \/>/<!--
|
27 |
-
sed -i 's/<policy domain="coder" rights="none" pattern="EPS" \/>/<!--
|
28 |
-
sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<!--
|
29 |
-
sed -i 's/<policy domain="coder" rights="none" pattern="XPS" \/>/<!--
|
30 |
-
sed -i 's/<policy domain="coder" rights="none" pattern="LABEL" \/>/<!--
|
31 |
-
sed -i 's/<policy domain="coder" rights="none" pattern="TEXT" \/>/<!--
|
32 |
-
sed -i 's/<policy domain="path" rights="none" pattern="@*" \/>/<!--
|
33 |
echo "INFO: ImageMagick policy potentially updated."; \
|
34 |
else \
|
35 |
-
echo "WARNING: ImageMagick policy.xml not found. TextClip might fail."; \
|
36 |
fi \
|
37 |
) && \
|
38 |
apt-get clean && \
|
|
|
10 |
libxext6 \
|
11 |
fontconfig \
|
12 |
imagemagick \
|
13 |
+
ghostscript && \
|
14 |
# Modify ImageMagick policy to be less restrictive for TextClip
|
15 |
+
# This entire block is a single shell command executed by RUN
|
16 |
+
# The semicolon after the fi is important for shell syntax if followed by &&
|
17 |
+
# We ensure the subshell commands are properly chained with && inside the subshell
|
18 |
+
# and the whole subshell is one command in the RUN sequence.
|
|
|
19 |
( \
|
20 |
+
POLICY_FILE=$(find /etc/ImageMagick* -name policy.xml -print -quit 2>/dev/null) && \
|
21 |
+
if [ -n "$POLICY_FILE" ] && [ -f "$POLICY_FILE" ]; then \
|
22 |
echo "INFO: Modifying ImageMagick policy file: $POLICY_FILE"; \
|
23 |
+
sed -i 's/<policy domain="coder" rights="none" pattern="PS" \/>/<!-- & -->/' "$POLICY_FILE" && \
|
24 |
+
sed -i 's/<policy domain="coder" rights="none" pattern="PS2" \/>/<!-- & -->/' "$POLICY_FILE" && \
|
25 |
+
sed -i 's/<policy domain="coder" rights="none" pattern="PS3" \/>/<!-- & -->/' "$POLICY_FILE" && \
|
26 |
+
sed -i 's/<policy domain="coder" rights="none" pattern="EPS" \/>/<!-- & -->/' "$POLICY_FILE" && \
|
27 |
+
sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<!-- & -->/' "$POLICY_FILE" && \
|
28 |
+
sed -i 's/<policy domain="coder" rights="none" pattern="XPS" \/>/<!-- & -->/' "$POLICY_FILE" && \
|
29 |
+
sed -i 's/<policy domain="coder" rights="none" pattern="LABEL" \/>/<!-- & -->/' "$POLICY_FILE" && \
|
30 |
+
sed -i 's/<policy domain="coder" rights="none" pattern="TEXT" \/>/<!-- & -->/' "$POLICY_FILE" && \
|
31 |
+
sed -i 's/<policy domain="path" rights="none" pattern="@*" \/>/<!-- & -->/' "$POLICY_FILE" && \
|
32 |
echo "INFO: ImageMagick policy potentially updated."; \
|
33 |
else \
|
34 |
+
echo "WARNING: ImageMagick policy.xml not found or find command failed. TextClip might fail."; \
|
35 |
fi \
|
36 |
) && \
|
37 |
apt-get clean && \
|