Open tsauvajon opened 7 years ago
I'm still having the problem, with the same very simple Dockerfile
FROM alpine:latest
RUN apk --no-cache --update upgrade && apk --no-cache add ca-certificates
Have you tried restarting Docker for Windows? This is usually a DNS caching issue with the VM. If you can reproduce it reliably then maybe we need to get into the VM to debug further.
I'm also seeing this error in Docker for Windows (Docker version 17.09.0-ce, build afdb6d4) and Docker on Cent OS 7 (Docker version 17.06.2-ce, build cec0b72).
Same simple Dockerfile that tsauvajon posted above.
Sending build context to Docker daemon 731.1kB
Step 1/2 : FROM alpine:latest
---> 053cde6e8953
Step 2/2 : RUN apk --no-cache --update upgrade && apk --no-cache add ca-certificates
---> Running in 319b33e585ce
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.6/main: IO ERROR
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz: IO ERROR
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.6/community: IO ERROR
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz: IO ERROR
OK: 4 MiB in 11 packages
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz: IO ERROR
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz: IO ERROR
ERROR: unsatisfiable constraints:
ca-certificates (missing):
required by: world[ca-certificates]
The command '/bin/sh -c apk --no-cache --update upgrade && apk --no-cache add ca-certificates' returned a non-zero code: 1
Have restarted the VM multiple times and restarted my computer also. I am running Windows 10.
@andyshinn Yes I tried tens of times, while restarting my Windows host and my Docker for Windows several times.
I have this problem too, though I am using Google's container builder. Maybe one or two out of a dozen builds will throw the IO error and force manual intervention to re-run the build step. I have not seen it fail on the second attempt.
This may just be a guess, but considering container builder is a highly jailed environment within some of the best networked datacenters on the planet, I very much doubt it is a "client side" issue.
I'm seeing it on 3.7, fwiw:
Step #1: fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz Step #1: fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz Step #1: ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/main: IO ERROR
I've been running into a similar infuriating issue. Sometimes, I get IO errors installing packages with apk
. It seems dependent on how much IO is being performed: an image installing eleven packages only rarely gets these, all I have to do is run build again, while an image installing 86 packages never succeeds.
$ docker build .
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM docker:latest
---> fd7e073eb60f
Step 2/2 : RUN apk update && apk add openssh-client openjdk8-jre terraform libc-dev py-pip gnupg make curl bash git go jq
---> Running in 6f1483a689d8
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
v3.8.1-62-ga10c10dd7d [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
v3.8.1-61-g338ad9f579 [http://dl-cdn.alpinelinux.org/alpine/v3.8/community]
OK: 9546 distinct packages available
(1/86) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(2/86) Installing ncurses-terminfo (6.1_p20180818-r1)
ERROR: Failed to create usr/share/terminfo/x/xenix: I/O error
ERROR: ncurses-terminfo-6.1_p20180818-r1: IO ERROR
(3/86) Installing ncurses-libs (6.1_p20180818-r1)
(4/86) Installing readline (7.0.003-r0)
(5/86) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(6/86) Installing nghttp2-libs (1.32.0-r0)
...
...sometimes these errors are instead as such:
ERROR: ncurses-terminfo-6.1_p20180818-r1: BAD archive
Here's a Dockerfile that will reliably produce this for me:
FROM docker:latest
RUN apk update && apk add \
openssh-client \
openjdk8-jre \
terraform \
libc-dev \
py-pip \
gnupg \
make \
curl \
bash \
git \
go \
jq
Quite certain my NVMe drive is fine as it is only a few weeks old and I'm seeing no other IO issues or errors anywhere else.
Here's what I believe to be all the relevant system information::
DISTRIB_DESCRIPTION="Ubuntu 18.10"
Docker version 18.09.0, build 4d60db4
Linux my-pizza 4.18.0-11-generic #12-Ubuntu SMP Tue Oct 23 19:22:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
This looks to me like a Docker BuildKit issue, my build always fails with this IO ERROR with BuildKit enabled, and works when I disable it.
Opened an issue with BuildKit moby/buildkit#746
Definitely a problem with alpine image, installing gcc/g++ packages on the latest alpine fails with the I/O Error - simple test of adding write permissions to everyone on the /usr folder - make the install work. The maintainers of the image should fix it.
This was helpful for me.
I am facing same issue with apk add
, some package will failed to install and everytime error message will be different, any different packages might fail but mostly gcc
or g++
will fail, always failed to create some files
These are errors collected when building the exact same project, no file is modified between these attempts, suddenly success during my 3rd attempt, so it totally became a try your luck situation
(9/26) Installing gcc (11.2.1_git20220219-r2)
ERROR: Failed to create usr/bin/lto-dump: Connection aborted
ERROR: gcc-11.2.1_git20220219-r2: IO ERROR
(9/26) Installing gcc (11.2.1_git20220219-r2)
ERROR: Failed to create usr/libexec/gcc/x86_64-alpine-linux-musl/11.2.1/liblto_plugin.so: Connection aborted
ERROR: gcc-11.2.1_git20220219-r2: IO ERROR
@eslym Could it be because of rate limiting?
I'm facing the same issue while building an image with BuildKit enabled (MacOS). The process of adding APK packages is failing on random IO errors.
ARG ALPINE_VERSION=3.18
ARG GOLANG_VERSION=1.19.9
FROM --platform=linux/amd64 docker.io/golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION}
RUN set -eux \
&& apk update \
&& apk add --no-cache \
bash=5.2.15-r5 \
ca-certificates=20240226-r0 \
curl=8.5.0-r0 \
docker-cli=25.0.3-r0 \
gcc=12.2.1_git20220924-r10 \
git=2.40.1-r0 \
helm=3.11.3-r4 \
librdkafka-dev=2.1.1-r0 \
make=4.4.1-r1 \
musl-dev=1.2.4-r2 \
openssl=3.1.4-r5 \
py3-pip=23.1.2-r0 \
python3=3.11.8-r0 \
python3-dev=3.11.8-r0 \
&& rm -rf /var/cache/apk/*
Hello everyone! Any news on this issue?
Wow, 7 years later and no solution. Time to look for a different distro....
and still...
Every time I try to install a package via
apk add
I get IO ERRORs:I'm using the alpine:3.6 image on Windows 10 (Docker for Windows - Linux containers)
apk update
gives similar results:I don't seem to have a connection problem: