overlayfs fails to run container with a strange file checksum error

I started to use "overlay" driver today and seeing odd behaviors in my containers (CentOS 6).

  1. yum install <pkg> in Dockerfile always fails, but running it again in the same container always succeeds.
  2. tail -f <file> doesn't show appended contents

For 1, this simple Dockerfile always fails at second yum install (for perl)

FROM centos:centos6

RUN yum install -y sudo
RUN yum install -y perl

with this error:

Step 2 : RUN yum install -y perl
 ---> Running in 21669e152088
...
Rpmdb checksum is invalid: dCDPT(pkg checksums): perl-version.x86_64 3:0.77-136.el6_6.1 - u

INFO[0018] The command [/bin/sh -c yum install -y perl] returned a non-zero code: 1

However, running the same command twice in the same container always succeeds.

FROM centos:centos6

RUN yum install -y sudo 
RUN (yum install -y perl || yum install -y perl)
Step 2 : RUN (yum install -y perl || yum install -y perl)
 ---> Running in 5bf1177b4437
...

Rpmdb checksum is invalid: dCDPT(pkg checksums): perl-version.x86_64 3:0.77-136.el6_6.1 - u
  Installing : 4:perl-5.10.1-136.el6_6.1.x86_64                             6/6
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.vastspace.net
 * extras: mirror.vastspace.net
 * updates: mirror.vastspace.net
Package 4:perl-5.10.1-136.el6_6.1.x86_64 already installed and latest version
Nothing to do
 ---> 2671034175e9
Removing intermediate container 5bf1177b4437
Successfully built 2671034175e9

Even though I change perl to something else, I get the same behavior.

For 2, I noticed that doing tail -f <application.log> first shows last 10 lines of the log file, then it doesn't show any appended contents. If I press Ctrl+C and redo, it will show the most recent contents.

I have only tried the official centos:centos6 image so far, and the above behavior is 100% reproducible. I didn't try other images.

Docker Host:

CoreOS latest alpha with ext4 root file system and "overlay" driver. I'm running it on EC2, and recreated it once but the problem persists.

core@core-01 ~ $ cat /etc/os-release
NAME=CoreOS
ID=coreos
VERSION=561.0.0
VERSION_ID=561.0.0
BUILD_ID=
PRETTY_NAME="CoreOS 561.0.0"
ANSI_COLOR="1;32"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues"

Docker Version and Info:

core@core-01 ~ $ docker --version
Docker version 1.4.1, build 5bc2ff8-dirty

core@core-01 ~ $ docker info
Containers: 1
Images: 4
Storage Driver: overlay
Execution Driver: native-0.2
Kernel Version: 3.18.2
Operating System: CoreOS 561.0.0
CPUs: 1
Total Memory: 3.68 GiB
Name: core-01
ID: TM2L:NIZI:CUGT:EUKX:ACP3:EOFX:YQVR:CTL7:R7L2:ILQF:6E3H:HAHQ

Kernel Config:

core@core-01 ~ $ wget https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh
...
2015-01-19 11:09:00 (133 MB/s) - 'check-config.sh' saved [4476/4476]

core@core-01 ~ $ chmod a+x check-config.sh
core@core-01 ~ $ ./check-config.sh
info: reading kernel config from /proc/config.gz ...

Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_DEVPTS_MULTIPLE_INSTANCES: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_MACVLAN: enabled
- CONFIG_VETH: enabled
- CONFIG_BRIDGE: enabled
- CONFIG_NF_NAT_IPV4: enabled
- CONFIG_IP_NF_FILTER: enabled
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled
- CONFIG_NF_NAT: enabled
- CONFIG_NF_NAT_NEEDED: enabled
- CONFIG_POSIX_MQUEUE: enabled

Optional Features:
- CONFIG_MEMCG_SWAP: enabled
- CONFIG_RESOURCE_COUNTERS: enabled
- CONFIG_CGROUP_PERF: enabled
- Storage Drivers:
  - "aufs":
    - CONFIG_AUFS_FS: missing
    - CONFIG_EXT4_FS_POSIX_ACL: enabled
    - CONFIG_EXT4_FS_SECURITY: enabled
  - "btrfs":
    - CONFIG_BTRFS_FS: enabled
  - "devicemapper":
    - CONFIG_BLK_DEV_DM: enabled
    - CONFIG_DM_THIN_PROVISIONING: enabled
    - CONFIG_EXT4_FS: enabled
    - CONFIG_EXT4_FS_POSIX_ACL: enabled
    - CONFIG_EXT4_FS_SECURITY: enabled
  - "overlay":
    - CONFIG_OVERLAY_FS: enabled