I am using Alpine Linux 3.18
My base image is gradle:7.6.1-jdk17-alpine
RUN export ALPINE_VERSION=$(cat /etc/alpine-release | cut -d "." -f 1-2) && ` rm /etc/apk/repositories &&
echo "@main local_nexus/repository/alpine-proxy/v$ALPINE_VERSION/main" > /etc/apk/repositories &&
echo "@community local_nexus/repository/alpine-proxy/v$ALPINE_VERSION/community" >> /etc/apk/repositories
# Install build tools
RUN apk add --no-cache
git@main
docker-cli@community
curl@main
libaio@main
libc6-compat@main
libnsl@community &&
rm -rf /var/cache/apk/*
I am getting following error.
ERROR: unable to select packages:
libtirpc-conf-1.3.3-r2:
masked in: @main
satisfies: libtirpc-1.3.3-r2[libtirpc-conf]
krb5-conf-1.0-r2:
masked in: @main
satisfies: krb5-libs-1.20.1-r1[krb5-conf]
libcom_err-1.47.0-r2:
masked in: @main
satisfies: krb5-libs-1.20.1-r1[so:libcom_err.so.2]
keyutils-libs-1.6.3-r3:
masked in: @main
satisfies: krb5-libs-1.20.1-r1[so:libkeyutils.so.1]
libverto-0.3.2-r2:
masked in: @main
satisfies: krb5-libs-1.20.1-r1[so:libverto.so.1]
krb5-libs-1.20.1-r1:
masked in: @main
satisfies: libtirpc-1.3.3-r2[so:libgssapi_krb5.so.2]
libtirpc-1.3.3-r2:
masked in: @main
satisfies: libnsl-2.0.0-r0[so:libtirpc.so.3]
To install packages, I am using a corporate Nexus proxy URL which points to Alpine package repository. Other packages get installed without any complain which means there is no issue with the connectivity / certificates.
Any suggestions please
libnsl depends on 3 packages
https://pkgs.alpinelinux.org/package/v3.18/community/x86/libnsl
One of them is libtripc, which depends on libtirpc-conf
https://pkgs.alpinelinux.org/package/v3.18/main/x86/libtirpc-conf
2
Answers
Work around if you want to keep the
@main
and@community
, is to install the dependant packages manually.libnsl
is incommunity
but its dependant packages are inmain
, when you provide the package name aslibnsl@community
it cannot find the dependant packages inmain
This is what I suspect, I could be wrong.🗎
Dockefile
You don’t need to specify the
main
andcommunity
repositories when installing the packages.I believe that the issue with your approach arises from the
@main
and@community
at the beginning of the lines you are inserting into/etc/apk/repositories
. Remove those and the packages should install.Since I don’t have access to your proxy repositories, that’s impossible to test.