Skip to content

File content not changed but COPY command invalidates cache! #10336

@svenkroll

Description

@svenkroll

How to reproduce:

  • Create new Dockerfile using COPY command and commit to GIT repository
  • Checkout GIT repository and run Docker build on machine A
  • Push created images to private registry or export it
  • Pull image from private registry or import on machine B
  • Checkout the same commit from GIT repository and run Docker build on machine B

Result:

First run on machine A:

build   24-Jan-2015 22:58:16    Step 8 : RUN cd /usr/local/src/APC-3.1.13;     /usr/local/bin/phpize;     ./configure --with-php-config=/usr/local/bin/php-config;     make;     make install
build   24-Jan-2015 22:58:16     ---> Using cache
build   24-Jan-2015 22:58:16     ---> 1358556ef4ad
build   24-Jan-2015 22:58:16    Step 9 : COPY ./templates/php_modules/20-apc.ini /etc/php5/conf.d/20-apc.ini
build   24-Jan-2015 22:58:16     ---> 4b21637fa55b
build   24-Jan-2015 22:58:16    Removing intermediate container 3c2658197f2b

Second run on machine B:

build   25-Jan-2015 09:35:24    Step 8 : RUN cd /usr/local/src/APC-3.1.13;     /usr/local/bin/phpize;     ./configure --with-php-config=/usr/local/bin/php-config;     make;     make install
build   25-Jan-2015 09:35:24     ---> Using cache
build   25-Jan-2015 09:35:24     ---> 1358556ef4ad
build   25-Jan-2015 09:35:24    Step 9 : COPY ./templates/php_modules/20-apc.ini /etc/php5/conf.d/20-apc.ini
build   25-Jan-2015 09:35:24     ---> f77fe0b46890
build   25-Jan-2015 09:35:24    Removing intermediate container 473b3e831c87

Expected behaviour:

When file content not changed (as example md5 sum is the same) Docker has to use cached image.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions