Inconsistent modification time for created files

Expected behavior

When I run a build in a Docker, I expect the timestamps of the created files to be created consistently and compare cleanly to system time both within and outside the Docker.

Actual behavior

When running a script that contains the following commands:

cmake
make

I get the following output:

...
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ben/Projects/resu/build
make: Warning: File 'Makefile' has modification time 0.7 s in the future
make[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.63 s in the future
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
make: warning:  Clock skew detected.  Your build may be incomplete.

Information

OS X: version 10.11.4 (build: 15E65)
Docker.app: version v1.11.1-beta11
Running diagnostic tests:
[OK] docker-cli13 16:24:01 2016 from 10.12.0.47
[OK] Moby bootedsch-DCMG-Team-Norms.md
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160515-071237.tar.gz
Most specific failure is: No error was detected
Your unique id is: B3C9D397-2A20-4A58-A6FC-9C8E9DB77365
Please quote this in all correspondence.

Steps to reproduce the behavior

Using the following Dockerfile

FROM debian:8.1

RUN apt-get update
RUN apt-get install -y --no-install-recommends \
        build-essential \
        cmake \
        make
RUN rm -rf /var/lib/apt/lists/* && \
    apt-get clean

and the following CMakeLists.txt

cmake_minimum_required (VERSION 2.6)
project (foo)
add_executable(foo src/main.c)

use

docker run --volumes "$(pwd):$(pwd):rw" --workdir "$(pwd)" docker_name script_name

on a script containing the following lines:

cmake .
make
1 Like

I have the same issue when I run bundle install and the bundler tries to build json gem.

Current Behaviour

Installing json 1.8.3 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /opt/mydrive/app/vendor/gems/ruby/2.2.0/gems/json-1.8.3/ext/json/ext/parser
/usr/local/bin/ruby -r ./siteconf20160524-1752-nssh43.rb extconf.rb
creating Makefile

current directory: /opt/mydrive/app/vendor/gems/ruby/2.2.0/gems/json-1.8.3/ext/json/ext/parser
make "DESTDIR=" clean
make: Warning: File `Makefile' has modification time 0.96 s in the future
make: warning:  Clock skew detected.  Your build may be incomplete.

current directory: /opt/mydrive/app/vendor/gems/ruby/2.2.0/gems/json-1.8.3/ext/json/ext/parser
make "DESTDIR="
make: Warning: File `Makefile' has modification time 0.93 s in the future
compiling parser.c
linking shared-object json/ext/parser.so
make: warning:  Clock skew detected.  Your build may be incomplete.

current directory: /opt/mydrive/app/vendor/gems/ruby/2.2.0/gems/json-1.8.3/ext/json/ext/parser
make "DESTDIR=" install
make: Warning: File `Makefile' has modification time 0.21 s in the future
/usr/bin/install -c -m 0755 parser.so ./.gem.20160524-1752-xygcng/json/ext
make: warning:  Clock skew detected.  Your build may be incomplete.

Directory not empty @ sys_fail2 - (./.gem.20160524-1752-xygcng/json/ext, /opt/mydrive/app/vendor/gems/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/json-1.8.3/json/ext)

Gem files will remain installed in /opt/mydrive/app/vendor/gems/ruby/2.2.0/gems/json-1.8.3 for inspection.
Results logged to /opt/mydrive/app/vendor/gems/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/json-1.8.3/gem_make.out
Installing minitest 5.8.4

Steps to reproduce the behaviour
Just create a Gemfile with json gem as a dependency and run:
docker run -ti --rm -v ${PWD}:/opt/mydrive/app --workdir /opt/mydrive/app ruby:2.2.4 bundle install
Information
OS X: version 10.11.5 (build: 15F34)
Docker.app: version v1.11.1-beta12
Running diagnostic tests:
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160525-001547.tar.gz
Most specific failure is: No error was detected
Your unique id is: FF71A073-40F2-4C8F-9689-3EE3CFED40C4
Please quote this in all correspondence.

$ docker version
Client:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Wed Apr 27 00:34:20 2016
OS/Arch: darwin/amd64

Server:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 8b63c77
Built: Tue May 10 10:39:20 2016
OS/Arch: linux/amd64

Have either of you (or anyone else) come up for a workaround for this issue? I’m experiencing the same problem as @benrogers with make.

@pmdarrow it seems to be fixed in the Version 1.11.1-beta13.1.

I don’t think it is unfortunately. I just installed 1.11.1-beta13.1 (build: 8193) and have the same problem with make for one of my projects:

make: Warning: File `Makefile' has modification time 0.25 s in the future
make[1]: Warning: File `CMakeFiles/Makefile2' has modification time 0.19 s in the future
make[2]: Warning: File `Common/Messages/CMakeFiles/protobuf_generate.dir/progress.make' has modification time 0.17 s in the future
make[2]: Warning: File `Common/Error/CMakeFiles/Error.dir/flags.make' has modification time 0.17 s in the future
make[2]: Warning: File `Common/Statsd/CMakeFiles/statsd.dir/flags.make' has modification time 0.16 s in the future
make[2]: Warning: File `Common/Messages/CMakeFiles/areipc.dir/flags.make' has modification time 0.16 s in the future

Interesting. For me, make is not failing anymore.
Does $pinata doctor reports anything wrong? How does $pinata diagnose look like in your machine?

I’m not using pinata, I’m building my own project using make. In your example & @benrogers one make is also what is reporting the clock skew error.