Using docker version 1.4.1, build 5bc2ff8-dirty
on CoreOS 557.2.0
in EC2
# docker build .
Sending build context to Docker daemon 181 MB
Sending build context to Docker daemon
Step 0 : FROM fedora
INFO[0001] unexpected end of JSON input
This error betrays filesystem corruption, and probably contributed to CoreOS's decision to move away from BTRFS to overlayfs.
The issue is this file should contain a JSON blob for the daemon to read, but in this case it's empty:
# sudo ls -lasp /var/lib/docker/repositories-btrfs
0 -rw------- 1 root root 0 Feb 19 17:35 repositories-btrfs
The fix (to be run as root
):
# [[ ! -s /var/lib/docker/repositories-btrfs ]] && echo '{"Repositories":{}}' > /var/lib/docker/repositories-btrfs
If this is a production system a better solution would be to reallocate the containers to other hosts and tear the server down as there may be further issues with BTRFS - many users have reported strange behaviour.