Docker Community Forums

Share and learn in the Docker community.

Get input/output error when running docker build


(Stonemind) #1

Recently, I always got the the following error to run docker build:

[myname@mymachine Base]$ docker build .
Sending build context to Docker daemon 327.1 MB
Sending build context to Docker daemon
Step 0 : FROM centos:latest
—> 3aa28fd030d9
Step 1 : COPY installer /installer
INFO[0002] mkdir /var/lib/docker/devicemapper/mnt/235fddeae8036f4edd5052d2b7f0dbab955532ec3c99b3e2c992e4f4f1c10739-init/rootfs: input/output error

I searched in the internet, and did not see any valuable comments


(David Maze) #2

A blunt answer to this class of problem is to stop Docker, sudo rm -rf /var/lib/docker, and start it again. You’ll need to re-pull/re-build any local images you had.

(As I noted in another post, you should plan ahead in designing your Dockerfiles and what not so that this is straightforward.)


(Stonemind) #3

Thanks very much, Dmaze. Your approach works well up to now.