docker 使用 ubi 的构建器镜像

docker builder image using ubi

尝试使用 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