Skip to content

Commit 18be2cf

Browse files
authored
Merge pull request DSpace#11957 from tdonohue/install_ant_via_apt
[Docker] Install Apache Ant via `apt-get` instead of manual download.
2 parents eefe5dd + d2abf0f commit 18be2cf

File tree

3 files changed

+15
-30
lines changed

3 files changed

+15
-30
lines changed

Dockerfile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,11 @@ ARG TARGET_DIR=dspace-installer
4141
# COPY the /install directory from 'build' container to /dspace-src in this container
4242
COPY --from=build /install /dspace-src
4343
WORKDIR /dspace-src
44-
# Create the initial install deployment using ANT
45-
ENV ANT_VERSION=1.10.13
46-
ENV ANT_HOME=/tmp/ant-$ANT_VERSION
47-
ENV PATH=$ANT_HOME/bin:$PATH
48-
# Download and install 'ant'
49-
RUN mkdir $ANT_HOME && \
50-
curl --silent --show-error --location --fail --retry 5 --output /tmp/apache-ant.tar.gz \
51-
https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \
52-
tar -zx --strip-components=1 -f /tmp/apache-ant.tar.gz -C $ANT_HOME && \
53-
rm /tmp/apache-ant.tar.gz
44+
# Install Apache Ant
45+
RUN apt-get update \
46+
&& apt-get install -y --no-install-recommends ant \
47+
&& apt-get purge -y --auto-remove \
48+
&& rm -rf /var/lib/apt/lists/*
5449
# Run necessary 'ant' deploy scripts
5550
RUN ant init_installation update_configs update_code update_webapps
5651

Dockerfile.cli

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,11 @@ ARG TARGET_DIR=dspace-installer
3535
# COPY the /install directory from 'build' container to /dspace-src in this container
3636
COPY --from=build /install /dspace-src
3737
WORKDIR /dspace-src
38-
# Create the initial install deployment using ANT
39-
ENV ANT_VERSION=1.10.13
40-
ENV ANT_HOME=/tmp/ant-$ANT_VERSION
41-
ENV PATH=$ANT_HOME/bin:$PATH
42-
# Download and install 'ant'
43-
RUN mkdir $ANT_HOME && \
44-
curl --silent --show-error --location --fail --retry 5 --output /tmp/apache-ant.tar.gz \
45-
https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \
46-
tar -zx --strip-components=1 -f /tmp/apache-ant.tar.gz -C $ANT_HOME && \
47-
rm /tmp/apache-ant.tar.gz
38+
# Install Apache Ant
39+
RUN apt-get update \
40+
&& apt-get install -y --no-install-recommends ant \
41+
&& apt-get purge -y --auto-remove \
42+
&& rm -rf /var/lib/apt/lists/*
4843
# Run necessary 'ant' deploy scripts
4944
RUN ant init_installation update_configs update_code
5045

Dockerfile.test

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,11 @@ ARG TARGET_DIR=dspace-installer
4040
# COPY the /install directory from 'build' container to /dspace-src in this container
4141
COPY --from=build /install /dspace-src
4242
WORKDIR /dspace-src
43-
# Create the initial install deployment using ANT
44-
ENV ANT_VERSION=1.10.12
45-
ENV ANT_HOME=/tmp/ant-$ANT_VERSION
46-
ENV PATH=$ANT_HOME/bin:$PATH
47-
# Download and install 'ant'
48-
RUN mkdir $ANT_HOME && \
49-
curl --silent --show-error --location --fail --retry 5 --output /tmp/apache-ant.tar.gz \
50-
https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \
51-
tar -zx --strip-components=1 -f /tmp/apache-ant.tar.gz -C $ANT_HOME && \
52-
rm /tmp/apache-ant.tar.gz
43+
# Install Apache Ant
44+
RUN apt-get update \
45+
&& apt-get install -y --no-install-recommends ant \
46+
&& apt-get purge -y --auto-remove \
47+
&& rm -rf /var/lib/apt/lists/*
5348
# Run necessary 'ant' deploy scripts
5449
RUN ant init_installation update_configs update_code update_webapps
5550

0 commit comments

Comments
 (0)