'I want to Cache Docker's Yarn to speed up Build with Azure Pipelines
The following is specified
docker-compose.yml
services:
app:
build:
context: .
dockerfile: Dockerfile
command: "yarn start"
ports:
- "8080:8080"
volumes:
- ./app:/app
Dockerfile
FROM node:12.16.3
WORKDIR /app
COPY app/package.json .
COPY app/yarn.lock .
RUN yarn install
COPY . /app .
EXPOSE 8080
CMD yarn start
azure-pipelines-ci.yml
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
steps:
- task: Cache@2
inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
yarn | "$(Agent.OS)"
yarn
path: $(YARN_CACHE_FOLDER)
- script: |
docker-compose up -d
However, the cache is working, but Docker build speed remains the same How can I make it work?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
