# PGFPlots or PGFPlotsX with Docker

**URL:** <https://discourse.julialang.org/t/pgfplots-or-pgfplotsx-with-docker/82363>\
**Category:** Visualization\
**Tags:** docker, pgfplotsx\
**Created:** [June 7, 2022, 9:30am UTC](https://discourse.julialang.org/t/pgfplots-or-pgfplotsx-with-docker/82363 "2022-06-07T09:30:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iagoba\_Apellaniz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iagoba_apellaniz/32/34406_2.png) [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)\
**Post date:** [June 7, 2022, 9:30am UTC](https://discourse.julialang.org/t/pgfplots-or-pgfplotsx-with-docker/82363/1 "2022-06-07T09:30:44Z")

</div>

Dear @kristoffer.carlsson

I’m currently used to compile latex code within a docker container. The question is, how difficult would it be to have an option for producing the figures with a Docker image instead of using a local MikTex or TexLive?

Thank you very much.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 7, 2022, 4:19pm UTC](https://discourse.julialang.org/t/pgfplots-or-pgfplotsx-with-docker/82363/2 "2022-06-07T16:19:13Z")

</div>

I don’t really use docker so I don’t know how such a setup would look. If you could give an example of how you would use this then it shouldn’t be too hard to add an option to PGFPlotsX for it.

---

<div class="post-metadata">

**Author:** ![Iagoba\_Apellaniz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iagoba_apellaniz/32/34406_2.png) [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)\
**Post date:** [June 7, 2022, 9:38pm UTC](https://discourse.julialang.org/t/pgfplots-or-pgfplotsx-with-docker/82363/3 "2022-06-07T21:38:26Z")

</div>

I don’t use it in the command line neither. VS extension Latex Workshop does it for me. It is nice that the environment is exatly the same in all my and my colleagues’ computers. Basically it should be something like this

```julia
docker run --rm -w <work_dir> -v <host_dir>:<container_dir> <image_name> pdflatex main.tex

```

It runs a container (`docker run`) from an image (`<image_name>`) and executes `pdflatex`. Then,

- `--rm` removes the container when it exits (finishes).
- `-w <work_dir>` sets the working directory inside the container where the `pdflatex` runs.
- `-v <host_dir>:<container_dir>` mounts a directory from the host computer to the container.

Indeed the most common setting is that `<work_dir>` = `<host_dir>` = `<container_dir>` = `$PWD`, so the command runs as if it was executed in the current path.

In most images there are available almost all LaTeX commands.

Finally, I think that the user of PGFPlots(X).jl package could have the option of choosing the image with which wants to produce the figure. For example (roughly 😃 )

```julia
julia> lateximage() # normal functioning of the package

julia> lateximage!("blang/latex") # the package produces all images using the containerized image 
PGFPlotsX.DOCKER_IMAGE = "blang/latex" 

```

I think this option should affect basically when the figure is produced and nothing else [[https://kristofferc.github.io/PGFPlotsX.jl/stable/man/save/](https://kristofferc.github.io/PGFPlotsX.jl/stable/man/save/)]. Am I right?

Thank you very much.

---

<div class="post-metadata">

**Author:** ![Iagoba\_Apellaniz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iagoba_apellaniz/32/34406_2.png) [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)\
**Post date:** [June 19, 2022, 8:45pm UTC](https://discourse.julialang.org/t/pgfplots-or-pgfplotsx-with-docker/82363/4 "2022-06-19T20:45:03Z")

</div>

Maybe I could try to make it work if it’s not that complicated. For the meantime I get the `tikz` code, and it works.  
Where in the codebase should I start? Which parts should I consider?
