MiKTeX / docker-miktex

the Docker image for running MiKTeX
41 stars 28 forks source link

Install dependencies in WORKDIR/.miktex #22

Closed RobertHeim closed 3 years ago

RobertHeim commented 3 years ago

gitlab CI does not allow to cache dependencies outside the project directory. Hence, it would be great if the image could store the dependencies within the project dir. This would enable CIs to cache the dependencies that are installed on the fly and thereby make builds much faster.

So if the WORKDIR is set to /miktex/work then the dependencies should be stored, for example, in /miktex/work/.miktex

Then this would work:

image: miktex/miktex

build:
  variables:
    MIKTEX_GID: 1111
    MIKTEX_UID: 1111
  cache:
    paths:
#      - /miktex/.miktex/ <--- not possible to cache dependencies outside the project dir
      - ./miktex <--- this is fine
  script:
    - mpm --update-db
    - pdflatex main.tex
  artifacts:
    paths:
      - "*.pdf"

I think this would not affect other use cases of the image, because they still would need to set a mounted volume and only need to change the path where they mount it. However, it would also be fine if we could configure the image via an environment variable.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.