Skip to content

Commit 6f1a0a5

Browse files
committed
[SPARK-44176] Change apt to apt-get and remove useless cleanup
### What changes were proposed in this pull request? This patch change `apt` to `apt-get` and also remove useless `rm -rf /var/cache/apt/*; \`. And also apply the change to 3.4.0 and 3.4.1 ### Why are the changes needed? Address comments from DOI: - `apt install ...`, This should be apt-get (apt is not intended for unattended use, as the warning during build makes clear). - `rm -rf /var/cache/apt/*; \` This is harmless, but should be unnecessary (the base image configuration already makes sure this directory stays empty). See more in: [1] docker-library/official-images#13089 (comment) ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? CI passed Closes #47 from Yikun/apt-get. Authored-by: Yikun Jiang <[email protected]> Signed-off-by: Yikun Jiang <[email protected]>
1 parent 6f36415 commit 6f1a0a5

File tree

10 files changed

+13
-23
lines changed

10 files changed

+13
-23
lines changed

3.4.0/scala2.12-java11-python3-r-ubuntu/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ USER root
2020

2121
RUN set -ex; \
2222
apt-get update; \
23-
apt install -y python3 python3-pip; \
24-
apt install -y r-base r-base-dev; \
25-
rm -rf /var/cache/apt/*; \
23+
apt-get install -y python3 python3-pip; \
24+
apt-get install -y r-base r-base-dev; \
2625
rm -rf /var/lib/apt/lists/*
2726

2827
ENV R_HOME /usr/lib/R

3.4.0/scala2.12-java11-python3-ubuntu/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ USER root
2020

2121
RUN set -ex; \
2222
apt-get update; \
23-
apt install -y python3 python3-pip; \
24-
rm -rf /var/cache/apt/*; \
23+
apt-get install -y python3 python3-pip; \
2524
rm -rf /var/lib/apt/lists/*
2625

2726
USER spark

3.4.0/scala2.12-java11-r-ubuntu/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ USER root
2020

2121
RUN set -ex; \
2222
apt-get update; \
23-
apt install -y r-base r-base-dev; \
24-
rm -rf /var/cache/apt/*; \
23+
apt-get install -y r-base r-base-dev; \
2524
rm -rf /var/lib/apt/lists/*
2625

2726
ENV R_HOME /usr/lib/R

3.4.0/scala2.12-java11-ubuntu/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN groupadd --system --gid=${spark_uid} spark && \
2424
RUN set -ex; \
2525
apt-get update; \
2626
ln -s /lib /lib64; \
27-
apt install -y gnupg2 wget bash tini libc6 libpam-modules krb5-user libnss3 procps net-tools gosu libnss-wrapper; \
27+
apt-get install -y gnupg2 wget bash tini libc6 libpam-modules krb5-user libnss3 procps net-tools gosu libnss-wrapper; \
2828
mkdir -p /opt/spark; \
2929
mkdir /opt/spark/python; \
3030
mkdir -p /opt/spark/examples; \
@@ -33,7 +33,6 @@ RUN set -ex; \
3333
touch /opt/spark/RELEASE; \
3434
chown -R spark:spark /opt/spark; \
3535
echo "auth required pam_wheel.so use_uid" >> /etc/pam.d/su; \
36-
rm -rf /var/cache/apt/*; \
3736
rm -rf /var/lib/apt/lists/*
3837

3938
# Install Apache Spark

3.4.1/scala2.12-java11-python3-r-ubuntu/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ USER root
2020

2121
RUN set -ex; \
2222
apt-get update; \
23-
apt install -y python3 python3-pip; \
24-
apt install -y r-base r-base-dev; \
25-
rm -rf /var/cache/apt/*; \
23+
apt-get install -y python3 python3-pip; \
24+
apt-get install -y r-base r-base-dev; \
2625
rm -rf /var/lib/apt/lists/*
2726

2827
ENV R_HOME /usr/lib/R

3.4.1/scala2.12-java11-python3-ubuntu/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ USER root
2020

2121
RUN set -ex; \
2222
apt-get update; \
23-
apt install -y python3 python3-pip; \
24-
rm -rf /var/cache/apt/*; \
23+
apt-get install -y python3 python3-pip; \
2524
rm -rf /var/lib/apt/lists/*
2625

2726
USER spark

3.4.1/scala2.12-java11-r-ubuntu/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ USER root
2020

2121
RUN set -ex; \
2222
apt-get update; \
23-
apt install -y r-base r-base-dev; \
24-
rm -rf /var/cache/apt/*; \
23+
apt-get install -y r-base r-base-dev; \
2524
rm -rf /var/lib/apt/lists/*
2625

2726
ENV R_HOME /usr/lib/R

3.4.1/scala2.12-java11-ubuntu/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN groupadd --system --gid=${spark_uid} spark && \
2424
RUN set -ex; \
2525
apt-get update; \
2626
ln -s /lib /lib64; \
27-
apt install -y gnupg2 wget bash tini libc6 libpam-modules krb5-user libnss3 procps net-tools gosu libnss-wrapper; \
27+
apt-get install -y gnupg2 wget bash tini libc6 libpam-modules krb5-user libnss3 procps net-tools gosu libnss-wrapper; \
2828
mkdir -p /opt/spark; \
2929
mkdir /opt/spark/python; \
3030
mkdir -p /opt/spark/examples; \
@@ -33,7 +33,6 @@ RUN set -ex; \
3333
touch /opt/spark/RELEASE; \
3434
chown -R spark:spark /opt/spark; \
3535
echo "auth required pam_wheel.so use_uid" >> /etc/pam.d/su; \
36-
rm -rf /var/cache/apt/*; \
3736
rm -rf /var/lib/apt/lists/*
3837

3938
# Install Apache Spark

Dockerfile.template

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN groupadd --system --gid=${spark_uid} spark && \
2424
RUN set -ex; \
2525
apt-get update; \
2626
ln -s /lib /lib64; \
27-
apt install -y gnupg2 wget bash tini libc6 libpam-modules krb5-user libnss3 procps net-tools gosu libnss-wrapper; \
27+
apt-get install -y gnupg2 wget bash tini libc6 libpam-modules krb5-user libnss3 procps net-tools gosu libnss-wrapper; \
2828
mkdir -p /opt/spark; \
2929
mkdir /opt/spark/python; \
3030
mkdir -p /opt/spark/examples; \
@@ -33,7 +33,6 @@ RUN set -ex; \
3333
touch /opt/spark/RELEASE; \
3434
chown -R spark:spark /opt/spark; \
3535
echo "auth required pam_wheel.so use_uid" >> /etc/pam.d/su; \
36-
rm -rf /var/cache/apt/*; \
3736
rm -rf /var/lib/apt/lists/*
3837

3938
# Install Apache Spark

r-python.template

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ USER root
2121
RUN set -ex; \
2222
apt-get update; \
2323
{%- if HAVE_PY %}
24-
apt install -y python3 python3-pip; \
24+
apt-get install -y python3 python3-pip; \
2525
{%- endif %}
2626
{%- if HAVE_R %}
27-
apt install -y r-base r-base-dev; \
27+
apt-get install -y r-base r-base-dev; \
2828
{%- endif %}
29-
rm -rf /var/cache/apt/*; \
3029
rm -rf /var/lib/apt/lists/*
3130
{%- if HAVE_R %}
3231

0 commit comments

Comments
 (0)