12

currently on Ubuntu 16.04 LTS, trying to pull an image using Docker
I am trying to install AFLGo which had been integrated into OSS-Fuzz, and I've been stuck at step 2 for the longest time. The shell script is supposed to pull all the images from docker to install AFLGo but for some reason i keep getting this error message no matter what I tried

docker info:

uia65408@igl1534u:~/oss-fuzz$ docker info
Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 10
Server Version: 17.06.0-ce
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 9
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfb82a876ecc11b5ca0977d1733adbe58599088a
runc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.13.0-37-generic
Operating System: Ubuntu 16.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.44GiB
Name: igl1534u
ID: LSHK:IO3H:DHBU:OUX3:72LJ:HOYC:GIYW:QQV2:4IYC:YO7B:UXQC:FGUA
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Https Proxy: https://localhost:3128/
Username: swonlek
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

From the terminal, when I run infra/base-images/all.sh:

uia65408@igl1534u:~/oss-fuzz$ infra/base-images/all.sh
+ docker build --no-cache --pull -t gcr.io/oss-fuzz-base/base-image infra/base-images/base-image
Sending build context to Docker daemon   2.56kB
Step 1/9 : FROM ubuntu:16.04
16.04: Pulling from library/ubuntu
b234f539f7a1: Pull complete 
55172d420b43: Pull complete 
5ba5bbeb6b91: Pull complete 
43ae2841ad7a: Pull complete 
f6c9c6de4190: Pull complete 
Digest: sha256:b050c1822d37a4463c01ceda24d0fc4c679b0dd3c43e742730e2884d3c582e3a
Status: Downloaded newer image for ubuntu:16.04
 ---> 5e8b97a2a082
Step 2/9 : MAINTAINER mike.aizatsky@gmail.com
 ---> Running in baafeed270aa
 ---> c82edcb20ed5
Removing intermediate container baafeed270aa
Step 3/9 : ENV DEBIAN_FRONTEND noninteractive
 ---> Running in b5c817be13c1
 ---> f6dc9252b91a
Removing intermediate container b5c817be13c1
Step 4/9 : RUN apt-get update && apt-get upgrade -y && apt-get autoremove -y
 ---> Running in 7e9338006272
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
  Could not connect to archive.ubuntu.com:80 (91.189.88.162), connection timed out [IP: 91.189.88.162 80]
Err:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.162 80]
Err:3 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.162 80]
Err:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Could not connect to security.ubuntu.com:80 (91.189.88.149), connection timed out [IP: 91.189.88.149 80]
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not connect to archive.ubuntu.com:80 (91.189.88.162), connection timed out [IP: 91.189.88.162 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.162 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.162 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Could not connect to security.ubuntu.com:80 (91.189.88.149), connection timed out [IP: 91.189.88.149 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 ---> 74d5fe84a2bb
Removing intermediate container 7e9338006272
Step 5/9 : ENV OUT /out
 ---> Running in 60124eb58434
 ---> 083e8bdaa793
Removing intermediate container 60124eb58434
Step 6/9 : ENV SRC /src
 ---> Running in 1a7e2f88b637
 ---> dceb04aa1080
Removing intermediate container 1a7e2f88b637
Step 7/9 : ENV WORK /work
 ---> Running in d2688371da7c
 ---> c399b9058b66
Removing intermediate container d2688371da7c
Step 8/9 : ENV PATH "$PATH:/out"
 ---> Running in 5a26db6cda09
 ---> 2dff83d2a778
Removing intermediate container 5a26db6cda09
Step 9/9 : RUN mkdir -p $OUT $SRC $WORK && chmod a+rwx $OUT $SRC $WORK
 ---> Running in cc724c7e78f3
 ---> 9c37de0bf9c6
Removing intermediate container cc724c7e78f3
Successfully built 9c37de0bf9c6
Successfully tagged gcr.io/oss-fuzz-base/base-image:latest
+ docker build --no-cache -t gcr.io/oss-fuzz-base/base-clang infra/base-images/base-clang
Sending build context to Docker daemon  6.656kB
Step 1/12 : FROM gcr.io/oss-fuzz-base/base-image
 ---> 9c37de0bf9c6
Step 2/12 : MAINTAINER mike.aizatsky@gmail.com
 ---> Running in db25e12ee42d
 ---> abb0fcdd608d
Removing intermediate container db25e12ee42d
Step 3/12 : RUN apt-get -y update && apt-get install -y     libc6-dev   binutils    libgcc-5-dev
 ---> Running in 9e89aeb4e170
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
  Could not connect to archive.ubuntu.com:80 (91.189.88.161), connection timed out [IP: 91.189.88.161 80]
Err:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.161 80]
Err:3 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.161 80]
Err:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Could not connect to security.ubuntu.com:80 (91.189.91.23), connection timed out [IP: 91.189.91.23 80]
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not connect to archive.ubuntu.com:80 (91.189.88.161), connection timed out [IP: 91.189.88.161 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.161 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.88.161 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Could not connect to security.ubuntu.com:80 (91.189.91.23), connection timed out [IP: 91.189.91.23 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libc6-dev
E: Unable to locate package binutils
E: Unable to locate package libgcc-5-dev
The command '/bin/sh -c apt-get -y update && apt-get install -y     libc6-dev   binutils    libgcc-5-dev' returned a non-zero code: 100

infra/base-images/all.sh:

docker build --no-cache --pull -t gcr.io/oss-fuzz-base/base-image $@ infra/base-images/base-image
docker build --no-cache -t gcr.io/oss-fuzz-base/base-clang $@ infra/base-images/base-clang
docker build --no-cache -t gcr.io/oss-fuzz-base/base-builder -t gcr.io/oss-fuzz/base-libfuzzer $@ infra/base-images/base-builder
docker build --no-cache -t gcr.io/oss-fuzz-base/base-runner $@ infra/base-images/base-runner
docker build --no-cache -t gcr.io/oss-fuzz-base/base-runner-debug $@ infra/base-images/base-runner-debug

infra/base-images/base-image/dockerfile:

FROM ubuntu:16.04
MAINTAINER mike.aizatsky@gmail.com
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get upgrade -y && apt-get autoremove -y

ENV OUT=/out
ENV SRC=/src
ENV WORK=/work
ENV PATH="$PATH:/out"

RUN mkdir -p $OUT $SRC $WORK && chmod a+rwx $OUT $SRC $WORK

infra/base-images/base-clang/dockerfile:

FROM gcr.io/oss-fuzz-base/base-image
MAINTAINER mike.aizatsky@gmail.com

RUN apt-get -y update && apt-get install -y \
    libc6-dev \
    binutils \
    libgcc-5-dev

COPY checkout_build_install_llvm.sh /root/
# Keep all steps in the same script to decrease the number of intermediate
# layes in docker file.
RUN /root/checkout_build_install_llvm.sh
RUN rm /root/checkout_build_install_llvm.sh

# Setup the environment.
ENV CC "clang"
ENV CXX "clang++"
ENV CCC "clang++"

# FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is described at
# http://libfuzzer.info#fuzzer-friendly-build-mode

ENV CFLAGS "-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
ENV CXXFLAGS_EXTRA "-stdlib=libc++"
ENV CXXFLAGS "$CFLAGS $CXXFLAGS_EXTRA"

So far it only run until base-clang, so I won't spam the question with unnecessary code frfom the other dockerfiles.
There is connectivity, I can access http://archive.ubuntu.com/ubuntu through the browser.
I strongly suspect a networking issue, as I am working behind a corporate firewall. There are many similar looking error messages out there but I can't find one that is exactly the same, which has answers. Or the answers apply to older versions of ubuntu. I've been stuck on this for a week. Do I need to request for a corporate-proxyless wifi set up?

3
  • 1
    My problem occurs in docker, normal sudo apt-get in the terminal is fine Jul 4, 2018 at 3:15
  • Then do you use Apt through a proxy on the host system? Jul 8, 2018 at 1:21
  • Yep I think I did, it fixed this error when I changed the proxy settings Jul 9, 2018 at 1:06

1 Answer 1

8

I think I understand the problem. It was something to do with the proxy that docker was using, which was unrecognised (I think I may have changed it to an invalid address while troubleshooting other problems earlier)

There are 2 ways to go about this. Before that, use echo $http_proxy or echo $HTTP_PROXY to find what proxy you are using, or if you have another proxy that works you can use that too.

Okay first method:
If you are running a dockerfile, before RUN apt-get update && apt-get upgrade, set the environment with ENV
example:

FROM ubuntu:16.04
MAINTAINER someone@gmail.com
ENV DEBIAN_FRONTEND noninteractive
ENV http_proxy 'http://mainproxy.ucm.conti.de:8980'
ENV https_proxy 'https://mainproxy.ucm.conti.de:8980'
RUN apt-get update && apt-get upgrade -y && apt-get autoremove -y

Note: according to Docker documentation, if you want to unset the proxy, you should use RUN instead, and unset it in the same command, otherwise the value will persist in a lower layer. Anyways,

Second method:
You can define the proxy in /etc/default/docker

sudo nano /etc/default/docker
//under the line "If you need Docker to use an HTTP proxy..."
#export http_proxy="http://yourproxy:port"

and this worked for me! Now I have a different problem but yes this is solved FINALLY!

1
  • 3
    sudo docker build --tag=arachneui --build-arg http_proxy=YOUR-PROXY-IP:80 .
    – Sohrab
    Mar 18, 2019 at 14:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.