Open rommik opened 7 years ago
I used the host network mode to run alpine and the issue was solved:
docker run -it --network host alpine
this helped me https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.13.0#musl_1.2
there are several solutions
so I had to download default.json, change one line and pass --security-opt=seccomp=default.json to docker run
@andyshinn , RE: #334 (comment)
It was a DNS error for me. By setting
/etc/docker/daemon.json
with,{ "dns": ["8.8.8.8"] }
and then restarting docker with,
sudo service docker restart
I was able to build images again.
-In Windows
C:\Users\Administrator\.docker\daemon.json
And add this line.
{
...
"dns": ["8.8.8.8"]
}
it happens to me if I run
docker compose up
,
but it doesn't if I run
docker-compose up
My fix for drone was setting the repository as Trusted
under the repo settings in drone and then adding this to the docker build steps:
steps:
-
name: docker
image: plugins/docker
network_mode: host <----- this
Similar error happen to me when I try to build docker images from within my kubernetes cluster but my workflow is more complex
FROM docker:latest
# Update & Upgrade OS
RUN apk update
RUN apk upgrade
# https://github.com/aws/aws-cli/issues/4971#issuecomment-1330633153
COPY --from=devopscorner/aws-cli:latest /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=devopscorner/aws-cli:latest /usr/local/bin/ /usr/local/bin/
RUN apk add bash git
node(POD_LABEL) {
stage('Clone') {
git url: 'https://github.com/example/example/', branch: '${build_branch_name}', credentialsId: 'github-app'
container('aws-dockerizer') {
stage('Build and deploy') {
withAWS(credentials: 'aws-credentials', region: 'eu-central-1') {
sh '''#!/usr/bin/env bash
git config --global --add safe.directory ${WORKSPACE}
scripts/build_and_push_docker_image_to_aws.sh
'''
}
}
}
}
}
FROM ruby:3.1.2-alpine
RUN apk add --update --no-cache binutils-gold build-base curl file g++ gcc git less libc-dev htop libffi-dev libgcrypt-dev libstdc++ libxml2-dev libxslt-dev linux-headers make netcat-openbsd nodejs yarn openssl pkgconfig postgresql-dev ruby-full tzdata
I run into the following errors from the jenkins-spawned pod
#6 4.372 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
#6 9.404 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
#6 9.404 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.16/main: temporary error (try again later)
#6 14.41 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.16/community: temporary error (try again later)
So I don't really have a sysadmin-like access, my image is being built from a pod connected to docker via a volume mount on the docker socket. It make it hard to run any OS/config patch
apiVersion: v1
kind: Pod
spec:
containers:
- name: aws-dockerizer
image: example/aws-dockerizer:0.1.3
command: ['cat']
tty: true
volumeMounts:
- name: dockersock
mountPath: /var/run/docker.sock
volumes:
- name: dockersock
hostPath:
path: /var/run/docker.sock
Since there are times when the bridge is disturbing, it is successful if you execute it as host.
docker build -t hoge:latest . --network=host
After struggling for so long with what I though was a kubernetes specific docker-in-docker issue, I ended up adding the --network=host
in my scripts commands and it fixed it. I should have tried that first instead of going nuts.
I have the same issue with "slow" internet connection. Is "slow" for Docker, maybe it have low parameter for "temporary error"
Still happening...
I also had this issue randomly building ingress-nginx
images on Docker Desktop.
0.260 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
5.295 WARNING: updating https://dl-cdn.alpinelinux.org/alpine/v3.18/main: temporary error (try again later)
5.295 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
10.41 WARNING: updating https://dl-cdn.alpinelinux.org/alpine/v3.18/community: temporary error (try again later)
I added the "dns": ["8.8.8.8"]
line to the Docker Desktop config and now it builds consistently.
Same issue trying to build python:3.11-alpine
.
Solved by adding another dns, like '9.9.9.9' (Quad9), in my existing list in /etc/docker/daemon.json
:
{
"dns": ["42.xx.xx.42", "9.9.9.9"]
}
as described in previous comment > https://github.com/gliderlabs/docker-alpine/issues/334#issuecomment-1135351701
Any recommendations to address it ?
So far, I have tried
Since there are times when the bridge is disturbing, it is successful if you execute it as host.
docker build -t hoge:latest . --network=host
After struggling for so long with what I though was a kubernetes specific docker-in-docker issue, I ended up adding the
--network=host
in my scripts commands and it fixed it. I should have tried that first instead of going nuts.
where did u add the netwrok =true ? is that in the jenkins agent config command?
Ignore everything below, it was an IPV6 problem, not related
Figured it out what caused it for me. I had enabled IPV6 on my host and that caused the only DNS server in /etc/resolv.conf to also be IPV6. Disabling IPV6 again caused the build to run through. I could pretty much consistently trigger a failed/successful build by switching between an IPV6 DNS server and an IPV4 DNS server.
Some more info:
OS: Debian 12
OCI: Podman
Network changes relevant:
sudo nano /etc/network/interfaces
and then adding
iface eth0 inet6 dhcp
dhcp6-pd yes
(Replace eth0 with whatever your actual network interface is) Then just restart networking (sudo service networking restart)
As soon as you get the files once it won't reproduce until you clear all the build caches.
I had this error with Gitlab, i just change docker build command to run with --network host option and it works!
works for me
In my case, I got this error when ca-certificates
package is not installed and set /etc/apk/repositories
to a HTTPS mirror, e.g.:
https://mirrors.aliyun.com/alpine/v3.18/main
https://mirrors.aliyun.com/alpine/v3.18/community
To work around, use HTTP mirror:
RUN sed -e 's/https:\/\/dl-cdn.alpinelinux.org/http:\/\/mirrors.aliyun.com/g' \
-i /etc/apk/repositories \
&& apk add --no-cache tzdata
I used a borrowed retry function to get past this:
function retry {
local retries=$1
shift
local count=0
until "$@"; do
exit=$?
wait=$((2 ** $count))
count=$(($count + 1))
if [ $count -lt $retries ]; then
echo "Retry $count/$retries exited $exit, retrying in $wait seconds..."
sleep $wait
else
echo "Retry $count/$retries exited $exit, no more retries left."
return $exit
fi
done
return 0
}
retry 10 apk add --no-cache aws-cli jq
Another data point for those who stumble upon this thread: my issue was with Tailscale, needed to turn off stateful filtering with tailscale up --stateful-filtering=false
I run into this issue when building a docker image on Ubuntu Host. The Same build on Windows 10 using docker-tools CLI (so technically inside a VirtualBox VM) has no issues and Docker images are built correctly.
I have reinstalled Docker on my Ubuntu completely to have a fresh version just in case. Any suggestions what else I can do to troubleshoot this issue?
Build command output
My dockerfile