使用ubi的docker builder映像

问题描述

尝试使用ibmcom / websphere-liberty:full-java8-ibmjava-ubi(RHEL8.2)作为构建器映像,并尝试安装ant但没有成功

[root@d68aa2dcc111 /]# yum -y install ant
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last Metadata expiration check: 0:26:00 ago on Tue Aug 25 21:01:43 2020.
No match for argument: ant
Error: Unable to find a match: ant```

解决方法

您可以使用以下命令通过“ wget”安装获取二进制文件:

ENV ANT_VERSION=1.10.8
RUN wget http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz \
    && tar xvfvz apache-ant-${ANT_VERSION}-bin.tar.gz -C /opt \
    && ln -sfn /opt/apache-ant-${ANT_VERSION} /opt/ant \
    && sh -c 'echo ANT_HOME=/opt/ant >> /etc/environment' \
    && ln -sfn /opt/ant/bin/ant /usr/bin/ant \
    && rm apache-ant-${ANT_VERSION}-bin.tar.gz