1"use strict";(self.webpackChunkbatect_dev=self.webpackChunkbatect_dev||[]).push([[432],{3905:function(e,t,n){n.d(t,{Zo:function(){return p},kt:function(){return m}});var r=n(7294);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if(null==e)return{};var n,r,c=function(e,t){if(null==e)return{};var n,r,c={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(c[n]=e[n]);return c}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}var s=r.createContext({}),l=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=l(e.components);return r.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,c=e.mdxType,o=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=l(n),f=c,m=u["".concat(s,".").concat(f)]||u[f]||d[f]||o;return n?r.createElement(m,a(a({ref:t},p),{},{components:n})):r.createElement(m,a({ref:t},p))}));function m(e,t){var n=arguments,c=t&&t.mdxType;if("string"==typeof e||c){var o=n.length,a=new Array(o);a[0]=f;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[u]="string"==typeof e?e:c,a[1]=i;for(var l=2;l<o;l++)a[l]=n[l];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}f.displayName="MDXCreateElement"},5428:function(e,t,n){n.r(t),n.d(t,{assets:function(){return p},contentTitle:function(){return s},default:function(){return m},frontMatter:function(){return i},metadata:function(){return l},toc:function(){return u}});var r=n(7462),c=n(3366),o=(n(7294),n(3905)),a=["components"],i={title:"Caches"},s=void 0,l={unversionedId:"concepts/caches",id:"concepts/caches",title:"Caches",description:"Batect supports mounting directories from the local filesystem into a container. This allows data to be persisted between task invocations, and",source:"@site/docs/concepts/caches.md",sourceDirName:"concepts",slug:"/concepts/caches",permalink:"/docs/concepts/caches",draft:!1,editUrl:"https://github.com/batect/batect.dev/blob/main/docs/concepts/caches.md",tags:[],version:"current",frontMatter:{title:"Caches"},sidebar:"sidebar",previous:{title:"Containers",permalink:"/docs/concepts/containers"},next:{title:"Includes and bundles",permalink:"/docs/concepts/includes-and-bundles"}},p={},u=[],d={toc:u},f="wrapper";function m(e){var t=e.components,n=(0,c.Z)(e,a);return(0,o.kt)(f,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"Batect supports mounting directories from the local filesystem into a container. This allows data to be persisted between task invocations, and\nfor the container to access local files such as application code."),(0,o.kt)("p",null,"However, Batect supports an alternative mechanism called a cache which is designed to provide high performance data persistence between task invocations.\nThese are often necessary for downloaded packages and libraries, such as Node.js's ",(0,o.kt)("inlineCode",{parentName:"p"},"node_modules")," directory or Golang's ",(0,o.kt)("inlineCode",{parentName:"p"},"GOPATH"),", where performance is\ncritical but accessibility outside the container is less important."),(0,o.kt)("p",null,"The need for this alternative mechanism stems from the fact that on macOS and Windows, ordinary Docker directory mounts like these come with a significant\nperformance penalty. While acceptable for application code, this performance penalty quickly accumulates when used for many files, as is the case for cached\npackages and libraries."),(0,o.kt)("p",null,"For details see ",(0,o.kt)("a",{parentName:"p",href:"/docs/reference/config/containers#caches"},"how to use caches with containers"),"."))}m.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.