Docker映像似乎已缓存到目录

时间:2019-02-18 19:06:58

标签: docker

我有一个docker映像

dockerfile是

FROM cypress/base:8

WORKDIR /cypress

RUN echo '{}' > package.json && \
  npm install cypress cypress-plugin-retries

当我从根目录运行以下命令时,我得到

crp11070m:latest-chrome $ docker run -it latest-chrome sh -c "more package.json"
{
  "dependencies": {
    "cypress": "^3.1.5",
    "cypress-plugin-retries": "^1.2.0"
  }
}

但是,如果我转到项目目录并运行我得到的相同命令

crp11070m:bsb-cypress-run-script $ docker run -it latest-chrome sh -c "more package.json"
{
        "name": "cypress-functional",
        "version": "1.0.0",
        "description": "Packages for Cypress",
        "main": "index.js",
        "dependencies": {
                "aws-sdk": "^2.316.0",
                "axios": "^0.18.0",
                "express": "^4.16.2"
        },
        "devDependencies": {
                "glob": "^7.1.3",
                "cypress": "^3.1.3",
                "eslint": "^4.14.0",
                "eslint-config-airbnb": "^16.1.0",
                "eslint-config-airbnb-base": "^12.1.0",
                "eslint-plugin-import": "^2.8.0",
                "eslint-plugin-jsx-a11y": "^6.0.3",
                "eslint-plugin-react": "^7.5.1",
                "mocha": "^3.5.3",
                "mocha-simple-html-reporter": "^1.1.0",
                "mochawesome-cypress-bsb": "^1.0.0"
        },

我不希望package.json中有多余的垃圾,那是陈旧的东西。

docker是否将图像缓存到目录的本地级别?

谢谢

0 个答案:

没有答案