mongosh not working on AlpineLinux

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Problem Statement/Rationale

      mongosh (1.5.0) not work on AlpineLinux

      Steps to Reproduce

      docker run --rm --name alpinetest -it alpine:latest sh 
      apk add --no-cache wget curl musl-dev krb5-libs gcompat libgcc
      
      MONGOSH_VERSION="$(curl -s https://api.github.com/repos/mongodb-js/mongosh/releases/latest | grep 'tag_name' | cut -d\" -f4 | sed 's/[^0-9.]*//g')"
      
      wget -qO- https://downloads.mongodb.com/compass/mongosh-${MONGOSH_VERSION}-linux-x64.tgz  | tar xfz - --strip-components=2 -C ./ mongosh-${MONGOSH_VERSION}-linux-x64/bin
      
      mv mongosh /usr/local/bin/
      
      mv mongosh_*.so /usr/local/lib/
      
      chmod +x /usr/local/bin/mongosh
      
      mongosh 

      Expected Results

       

      root@****:/# mongosh
      Current Mongosh Log ID: 629f51fcdcf63757eb0b2424
      Connecting to:          mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.5.0
      MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017 

      Actual Results

       

      root@****:/# mongosh
      Error loading shared library libresolv.so.2: No such file or directory (needed by /usr/local/bin/mongosh)
      Error relocating /usr/local/bin/mongosh: __res_nsearch: symbol not found
      Error relocating /usr/local/bin/mongosh: __dn_expand: symbol not found 

      Additional Notes

      This should help with Alpine and Oracle (internet search), but it does not work here:

      ln -s /usr/lib/libresolv.a /usr/lib/libresolv.so.2 

      Error:

      Error relocating /usr/local/bin/mongosh: __res_nsearch: symbol not found
      Error relocating /usr/local/bin/mongosh: __dn_expand: symbol not found

            Assignee:
            Unassigned
            Reporter:
            Tobias Hargesheimer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: