Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit e9a157b

Browse files
committed
concatenate docker RUN commands
1 parent 141a3f7 commit e9a157b

File tree

1 file changed

+30
-44
lines changed

1 file changed

+30
-44
lines changed

Dockerfile

Lines changed: 30 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ RUN apt-get update \
1616
maven \
1717
make \
1818
gcc \
19+
# openssl \
1920
zlib1g-dev
2021

21-
RUN apt -y update
22-
23-
2422
ARG OPENSSL_VERSION=1.1.1q
2523
ARG PYTHON=python3
2624
ARG PIP=pip3
@@ -56,48 +54,36 @@ WORKDIR /sagemaker-sparkml-model-server
5654

5755
RUN mvn clean package
5856

59-
RUN cp ./target/sparkml-serving-3.3.jar /usr/local/lib/sparkml-serving-3.3.jar
60-
RUN cp ./serve.sh /usr/local/bin/serve.sh
61-
62-
RUN chmod a+x /usr/local/bin/serve.sh
57+
RUN cp ./target/sparkml-serving-3.3.jar /usr/local/lib/sparkml-serving-3.3.jar \
58+
&& cp ./serve.sh /usr/local/bin/serve.sh \
59+
&& chmod a+x /usr/local/bin/serve.sh
6360

6461
# remove the maven-shared-utils packages - older versions create vulnerabilities
65-
RUN find / -depth -name maven-shared-utils -type d -exec rm -r "{}" \;
66-
67-
# remove the surefire packages - contains versions of maven-shared-utils that create vulnerabilities
68-
RUN find / -depth -name surefire -type d -exec rm -r "{}" \;
69-
70-
# remove maven-shared-utils jar file with vulnerabilities
71-
# comment out if need to use maven utilities
72-
RUN rm /usr/share/java/maven-shared-utils.jar
73-
74-
# remove wagon-http-shaded jar file with vulnerabilities associated with org.jsoup:jsoup
75-
RUN rm /usr/share/java/wagon-http-shaded-3.3.4.jar
76-
77-
# remove plexus-utils directory because plexus-utils has vulnerabilities
78-
# comment out if need to use maven utilities
79-
RUN find / -depth -name plexus-utils -type d -exec rm -r "{}" \;
80-
81-
# remove old version of commons-compress with vulnerability
82-
RUN find / -depth -name commons-compress -type d -exec rm -r "{}/1.20" \;
83-
84-
# remove jar files from common-io v2.5 and 2.6 both have vulnerabilities
85-
RUN find / -name commons-io*2.5.jar -type f -exec rm "{}" \;
86-
RUN find / -name commons-io*2.6.jar -type f -exec rm "{}" \;
87-
88-
# remove jackson-databind
89-
RUN find / -name jackson-databind -type d -exec rm -r "{}/2.13.3" \;
90-
91-
# remove junit-4.12.jar
92-
RUN find / -name junit-4.12.jar -type f -exec rm "{}" \;
93-
94-
# remove maven-compiler-plugin jar from maven repo
95-
RUN find / -name maven-compiler-plugin*.jar -type f -exec rm "{}" \;
96-
97-
# remove guava jar files
98-
RUN rm /usr/share/java/guava.jar && rm /root/.m2/repository/com/google/guava/guava/10.0.1/guava-10.0.1.jar
99-
100-
# remove commons-codec jar
101-
RUN find / -name commons-codec-1.11.jar -type f -exec rm "{}" \;
62+
RUN find / -depth -name maven-shared-utils -type d -exec rm -r "{}" \; \
63+
# remove the surefire packages - contains versions of maven-shared-utils that create vulnerabilities
64+
&& find / -depth -name surefire -type d -exec rm -r "{}" \; \
65+
# remove maven-shared-utils jar file with vulnerabilities
66+
# comment out if need to use maven utilities
67+
&& rm /usr/share/java/maven-shared-utils.jar \
68+
# remove wagon-http-shaded jar file with vulnerabilities associated with org.jsoup:jsoup
69+
&& rm /usr/share/java/wagon-http-shaded-3.3.4.jar \
70+
# remove plexus-utils directory because plexus-utils has vulnerabilities
71+
# comment out if need to use maven utilities
72+
&& find / -depth -name plexus-utils -type d -exec rm -r "{}" \; \
73+
# remove old version of commons-compress with vulnerability
74+
&& find / -depth -name commons-compress -type d -exec rm -r "{}/1.20" \; \
75+
# remove jar files from common-io v2.5 and 2.6 both have vulnerabilities
76+
&& find / -name commons-io*2.5.jar -type f -exec rm "{}" \; \
77+
&& find / -name commons-io*2.6.jar -type f -exec rm "{}" \; \
78+
# remove jackson-databind
79+
&& find / -name jackson-databind -type d -exec rm -r "{}/2.13.3" \; \
80+
# remove junit-4.12.jar
81+
&& find / -name junit-4.12.jar -type f -exec rm "{}" \; \
82+
# remove maven-compiler-plugin jar from maven repo
83+
&& find / -name maven-compiler-plugin*.jar -type f -exec rm "{}" \; \
84+
# remove guava jar files
85+
&& rm /usr/share/java/guava.jar && rm /root/.m2/repository/com/google/guava/guava/10.0.1/guava-10.0.1.jar \
86+
# remove commons-codec jar
87+
&& find / -name commons-codec-1.11.jar -type f -exec rm "{}" \;
10288

10389
ENTRYPOINT ["/usr/local/bin/serve.sh"]

0 commit comments

Comments
 (0)