skip to Main Content

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


  1. Chosen as BEST ANSWER

    Work around if you want to keep the @main and @community, is to install the dependant packages manually.

      libaio@main 
      libc6-compat@main 
      libintl@main 
      libtirpc@main 
      musl@main 
      libnsl@community 
    

    libnsl is in community but its dependant packages are in main, when you provide the package name as libnsl@community it cannot find the dependant packages in main This is what I suspect, I could be wrong.


  2. 🗎 Dockefile

    FROM gradle:7.6.1-jdk17-alpine
    
    RUN export ALPINE_VERSION=$(cat /etc/alpine-release | cut -d "." -f 1-2) && 
        rm /etc/apk/repositories && 
        echo "https://dl-cdn.alpinelinux.org/alpine/v$ALPINE_VERSION/main" > /etc/apk/repositories && 
        echo "https://dl-cdn.alpinelinux.org/alpine/v$ALPINE_VERSION/community" >> /etc/apk/repositories
    
    RUN apk add --no-cache 
            git 
            docker-cli 
            curl 
            libaio 
            libc6-compat 
            libnsl && 
        rm -rf /var/cache/apk/*
    

    You don’t need to specify the main and community 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.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search