See https://docs.docker.com/build/guide/mounts/ for details on cache mounts. See the kas Dockerfile as a practical example: https://github.com/siemens/kas/blob/master/Dockerfile