How to cache maven dependencies in Docker

前端 未结 3 1586
情深已故
情深已故 2021-02-04 16:35

I\'m working on a project with ~200MB dependencies and i\'d like to avoid useless uploads due to my limited bandwidth.

When I push my Dockerfile (i\'ll attach it in a m

3条回答
  •  情深已故
    2021-02-04 17:21

    The documentation of the official Maven Docker images also points out different ways to achieve better caching of dependencies.

    Basically, they recommend to either mount the local maven repository as a volume and use it across Docker images or use a special local repository (/usr/share/maven/ref/) the contents of which will be copied on container startup.

提交回复
热议问题