1

The beginning of this error is from creating and password based image in Azure environment. Below is the origin or this all. More info on this I just got to know we are using alpine based image.openjdk:8uX-alpine311 X11FontManager

So I did googled a bit and found some package needs to be installed and to do that I need to execute below command. RUN apt-get update; apt-get install -y fontconfig libfreetype6 which resulted me in

the command bin/sh sh returned a non zero code 127

After further analysis I found another solution to this is to run below query. RUN apk add --update fontconfig libfreetype6 as result again came as

the command bin/sh sh returned a non zero code 2

I am wondering this is just some package installation on azure environment, what it takes every time change in command's. Any help appreciated, thanks in advance.

Sam....
  • 165
  • 2
  • 19

1 Answers1

1
the command bin/sh sh returned a non zero code 127

Means the command wasn't found. Which is correct, since you're using an alpine image and apt-get is mostly found in debian based images. See also command '/bin/sh -c returned a non-zero code: 127

Testing your command on an local alpine:3.11 image I can verify that the command fails when trying to install libfreetype6

Try RUN apk add --update fontconfig freetype

You can verify if a package is available by checking pkgs.alpinelinux.org

0xdnL
  • 384
  • 3
  • 10
  • OK. Let me check by adding in docker file. – Sam.... Oct 01 '21 at 14:45
  • But again while deploying build on Develop it failed The command '/bin/sh -c apk add --update fontconfig freetype' returned a non-zero code: 2 – Sam.... Oct 04 '21 at 05:39
  • Hard to say since I can't find your image to test myself, but what you could do is try to run `docker run -ti --rm image.openjdk:8uX-alpine311 ash` and then run `apk add --update` manually and try to debug from inside the container. – 0xdnL Oct 04 '21 at 06:44
  • ok. Since this everything is organized by our org i dont know .. How much i can go inside . – Sam.... Oct 04 '21 at 10:56
  • Proxy was disabled at my end hence Command couldn't get executed in morning deops changed config , now build is successful and new error is introduced. .l.UnsatisfiedLinkError: /opt/java.64/jre/lib/amd64/libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory – Sam.... Oct 04 '21 at 13:39