Can't use HTTPS inside docker with docker bindings
Hello,
I got a rather special problem on my server. I tried to implement my gitlab runner to Use Docker socket binding like mentioned on the website. I wanted to test my setup and with a gitlab-ci-yml like this:
image: docker:latest
stages:
- build
- deploy
before_script:
- docker info
build:
stage: build
script:
- echo $https_proxy
- echo $HTTPS_PROXY
- wget --spider http://google.com
- wget --spider https://google.com
- docker build -t openpose-ros:CI_COMMIT_REF_NAME .
But no matter what I try, I always get this result:
1 Running with gitlab-runner 12.7.1 (003fe500)
2 on Docker Image build Runner
3 Using Docker executor with image docker:latest ...
4 Pulling docker image docker:latest ...
5 Using docker image sha256:f038f0462ba57cd4635fffba0f75f3f4f7421775ce041956e3af0fee613b227d for docker:latest ...
7 Running on runner-project-33-concurrent-0 via server...
$ git config --global http.proxy $HTTP_PROXY; git config --global https.proxy $HTTPS_PROXY
10 Fetching changes with git depth set to 50...
11 Reinitialized existing Git repository in /builds/User/docker-test/.git/
12 Checking out 02a7f441 as master...
13 Skipping Git submodules setup
$ docker info
18 Client:
19 Debug Mode: false
20 Server:
21 Containers: 25
22 Running: 2
23 Paused: 0
24 Stopped: 23
25 Images: 9
26 Server Version: 19.03.9
27 Storage Driver: overlay2
28 Backing Filesystem: extfs
29 Supports d_type: true
30 Native Overlay Diff: true
31 Logging Driver: json-file
32 Cgroup Driver: cgroupfs
33 Plugins:
34 Volume: local
35 Network: bridge host ipvlan macvlan null overlay
36 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
37 Swarm: inactive
38 Runtimes: runc
39 Default Runtime: runc
40 Init Binary: docker-init
41 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
42 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
43 init version: fec3683
44 Security Options:
45 apparmor
46 seccomp
47 Profile: default
48 Kernel Version: 4.15.0-91-generic
49 Operating System: Ubuntu 18.04.4 LTS
50 OSType: linux
51 Architecture: x86_64
52 CPUs: 8
53 Total Memory: 7.727GiB
54 Name: server
55 ID: ---
56 Docker Root Dir: /var/lib/docker-data/docker
57 Debug Mode: false
58 HTTP Proxy: http://proxy.url.de:80/
59 HTTPS Proxy: http://proxy.url.de:80/
60 Registry: https://index.docker.io/v1/
61 Labels:
62 Experimental: false
63 Insecure Registries:
64 127.0.0.0/8
65 Live Restore Enabled: false
66 WARNING: No swap limit support
$ echo $https_proxy
68 http://proxy.url.de:80
69 $ echo $HTTPS_PROXY
70 http://proxy.url.de:80
71 $ wget --spider http://google.com
72 Connecting to proxy.url.de:80
73 remote file exists
74 $ wget --spider https://google.com
75 Connecting to proxy.url.de:80
76 wget: server returned error: HTTP/1.1 501 Not Implemented
80 ERROR: Job failed: exit code 1
I get similar errors with apt-get
when I try to build a ubuntu container
My Runner config looks like this:
[[runners]]
name = "Docker Image build Runner"
url = "https://server.de/"
token = ""
executor = "docker"
pre_clone_script = "git config --global http.proxy $HTTP_PROXY; git config --global https.proxy $HTTPS_PROXY"
environment = ["https_proxy=http://proxy.url.de:80", "http_proxy=http://proxy.url.de:80", "HTTPS_PROXY=http://proxy.url.de:80", "HTTP_PROXY=http://proxy.url.de:80"]
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "docker:latest"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
shm_size = 0
[runners.cache]
Insecure = false
[runners.cache.s3]
[runners.cache.gcs]
Is there any Mistake I made to my configs or a step I missed? I am as you can probably imagine behind a proxy but http request works like a charm.