2

Hi I am trying to build up container using nginx, however,i am not able to move forward after these steps :

Building nginx
Step 1/17 : FROM nginx:alpine
---> 377c0837328f
Step 2/17 : LABEL maintainer="Mahmoud Zalt [email protected]"
---> Running in 8d53a074e85a
Removing intermediate container 8d53a074e85a
---> 6053f271c802
Step 3/17 : COPY nginx.conf /etc/nginx/
---> ba65da2b9c43
Step 4/17 : ARG CHANGE_SOURCE=false
---> Running in 1d31fc76ab76
Removing intermediate container 1d31fc76ab76
---> 8864e5fb904e
Step 5/17 : RUN if [ ${CHANGE_SOURCE} = true ]; then sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories ;fi
---> Running in d0f8c3bd67dd
Removing intermediate container d0f8c3bd67dd
---> c6e0c7aaf66f
Step 6/17 : RUN apk update && apk upgrade && apk --update add logrotate && apk add --no-cache openssl && apk add --no-cache bash
---> Running in 37305c5f0e55
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/main: network error (check Internet connection and firewall)
WARNING: Ignoring APKINDEX.00740ba1.tar.gz: No such file or directory
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/community: network error (check Internet connection and firewall)
WARNING: Ignoring APKINDEX.d8b2a6f4.tar.gz: No such file or directory
2 errors; 36 distinct packages available
ERROR: Service 'nginx' failed to build: The command '/bin/sh -c apk update && apk upgrade && apk --update add logrotate && apk add --no-cache openssl && apk add --no-cache bash' returned a non-zero code: 2

I use an ubuntu 18.04 Could you tell me how is fix it?

3
  • Could you please share the code inside your Dockerfile? Commented Apr 10, 2020 at 0:18
  • I use laradock (laradock.io) Commented Apr 11, 2020 at 17:01
  • Even then, laradock seems to be only abstracting the construction and maintenance of the Dockerfile for you, it should still exist somewhere. But, at any rate, as @Al-waleed Shihadeh points out, you actually seem to have a connection error actually. Commented Apr 11, 2020 at 17:21

2 Answers 2

3

From the logs provided, the issue seems to be a network issue:

 network error (check Internet connection and firewall)

Possible Root causes:

  • Your machine does not have internet access
  • You are using a proxy to access the internet
  • Your firewall does not allow the access
Sign up to request clarification or add additional context in comments.

3 Comments

on my machine (ubuntu 18.04 VPS Hosting Goddady) I have internet access. but on docker no. docker run busybox ping -c 1 8.8.8.8 PING 8.8.8.8 (8.8.8.8): 56 data bytes --- 8.8.8.8 ping statistics --- 1 packets transmitted, 0 packets received, 100% packet loss
check if IP forwarding is enabled or not: ducea.com/2006/08/01/how-to-enable-ip-forwarding-in-linux
cat /proc/sys/net/ipv4/ip_forward 1
0

Unable to access external web from docker container. I am unable to reach any external ip addresses from my docker containers except my own domain and some of the GoDaddy specific ones.

If i try to ping the google dns, which would have to be ping-able I get following response:

PING 8.8.8.8 (8.8.8.8): 56 data bytes

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 0 packets received, 100% packet loss```


Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.