# Plots.jl in a docker container

**URL:** https://discourse.julialang.org/t/plots-jl-in-a-docker-container/109254
**Category:** General Usage
**Tags:** docker, plots
**Created:** [January 25, 2024, 1:18pm UTC](https://discourse.julialang.org/t/plots-jl-in-a-docker-container/109254 "2024-01-25T13:18:59Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)
#### Post date: [January 25, 2024, 1:18pm UTC](https://discourse.julialang.org/t/plots-jl-in-a-docker-container/109254/1 "2024-01-25T13:18:59Z")

</div>

I am trying to use Plots.jl in a docker container (FROM julia:1.9.4-bookworm).

I think I am able to create the plots, but I get various warnings and errors from qt.

Examples include:

```julia
qt.core.plugin.factoryloader: Got keys from plugin meta data QList("vkkhrdisplay")
qt.core.plugin.factoryloader: checking directory path "/.julia/artifacts/7f59a0ec3d19c98dce30a3ba8ea9cbd8824ce4a6/bin/platforms" ...
qt.core.library: "/.julia/artifacts/466e859891e85a1f8a887e712f17b1645ec9c803/plugins/platforms/libqxcb.so" loaded library
qt.core.library: "libdbus-1" loaded library
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: vnc, eglfs, xcb, offscreen, minimal, linuxfb, minimalegl, vkkhrdisplay.

Aborted (core dumped)
connect: Connection refused
GKS: can't connect to GKS socket application

GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS

```

Here is a workflow (of an MWE I created) with the corresponding logs:

> <https://github.com/kafisatz/DockerPlotsMWE.jl/actions/runs/7654342783/job/20858144930#step:5:4061>

Does anybody know how to fix this?  
In essence I only need a lightweight plotting package. For now I would like to create a pie plot. I know there are various plotting packages. If you can recommend an alternative which does not need Qt and works on a headless server , I am all ears.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [January 25, 2024, 1:23pm UTC](https://discourse.julialang.org/t/plots-jl-in-a-docker-container/109254/2 "2024-01-25T13:23:36Z")

</div>

Is this any help?

[Deactivate plot display to avoid need for X server - Specific Domains / Visualization - Julia Programming Language (julialang.org)](https://discourse.julialang.org/t/deactivate-plot-display-to-avoid-need-for-x-server/19359)

---

<div class="post-metadata">

### Author: ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)
#### Post date: [January 25, 2024, 1:36pm UTC](https://discourse.julialang.org/t/plots-jl-in-a-docker-container/109254/3 "2024-01-25T13:36:23Z")

</div>

Yes. Thank you !

at the start of my julia script I just added:  
`ENV["GKSwstype"]="nul"`

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [January 25, 2024, 2:42pm UTC](https://discourse.julialang.org/t/plots-jl-in-a-docker-container/109254/4 "2024-01-25T14:42:07Z")

</div>

Veering offtopic… I first programmed using GKS graphics at CERN in the 1980s… I guess it still underlies many graphics front ends.

Ed: @johnh ? Veering offtopic?

---

<div class="post-metadata">

### Author: ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)
#### Post date: [January 26, 2024, 11:49am UTC](https://discourse.julialang.org/t/plots-jl-in-a-docker-container/109254/5 "2024-01-26T11:49:42Z")

</div>

Yes, that’s probably true. I wrote one of the first GKS implementations in the 80s (now part of GR) that ran on personal computers and mainframes. All the C and Fortran programs that our scientists wrote decades ago based on GKS still run today (without any changes). I would often wish the same for modern software. My conclusion: “Old” software doesn’t always have to be bad - as long as it is maintained. 😉
