docker icon indicating copy to clipboard operation
docker copied to clipboard

Fontconfig problem

Open pmatos opened this issue 7 years ago • 5 comments

I am getting a fontconfig problem in plot:

# racket
Welcome to Racket v7.1.
> (require plot/no-gui)
> (plot-file (function (lambda (x) (sin (* 4 x))) -1 1) #:x-min -1.5 #:x-max 1.5 #:y-min -1.5 #:y-max 1.5 "foo.png")
Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"

pmatos avatar Nov 14 '18 15:11 pmatos

This is with jackfirth/racket:7.1

pmatos avatar Nov 14 '18 15:11 pmatos

I'm seeing a few similar bug reports scattered across various projects, including one as recently as eight days ago. I suspect there's some upstream issue with the fontconfig library in the buildpack-deps images we're using as base images. In the meantime, would you be willing to add a line to the test.sh script that runs the plot-file code you've shared? A failing test would be a useful starting point.

jackfirth avatar Nov 16 '18 06:11 jackfirth

Jack, sorry, only just noticed that I didn't add the line you requested to test.sh . However it's not as easy as adding a line. We need to run:

raco pkg install --auto plot
racket -e '(require plot/no-gui) (plot-file (function (lambda (x) x)) #:x-min 0 #:x-max 1 #:y-min 0 #:y-max 1 "foo.png")'

I am not really very knowledgeable of docker. Do you know how to run both of these command inside a docker container? I imagined you could have a script with them, somehow copy them into the container, and then run it using the normal docker run command.

pmatos avatar Feb 21 '19 12:02 pmatos

I haven't tried it, but according to this stackoverflow answer the way to do this is to docker run the shell and hand the shell a single command that uses the semicolon operator to join together the two commands you want to run. Example: docker run image /bin/bash -c "cd /path/to/somewhere; python a.py"

jackfirth avatar Feb 21 '19 17:02 jackfirth

Update: I still see this error in the minimal images, but in the full distribution images work fine. I've tested with jackfirth/racket:7.1-full and jackfirth/racket:7.4-full and both successfully write the plot to a file.

jackfirth avatar Sep 09 '19 20:09 jackfirth