I am developing behind the company's proxy server using Linux Mint Sylvia (Docker was installed via Xenial Ubuntu 16.04.3 source).
$ docker -v Docker version 17.12.1-ce, build 7390fc6
I followed the steps below to upload some images via dockers.
My http-proxy.conf:
$ cat /etc/systemd/system/docker.service.d/http-proxy.conf [Service] Environment="HTTP_PROXY=http://my_user: my_pass@company _proxy:3128/" Environment="HTTPS_PROXY=https://my_user: my_pass@company _proxy:3128/" Environment="NO_PROXY=localhost,127.0.0.0/8"
My /etc/default/docker :
I need to run curl inside an Alpine multi-stage container, for simplicity I created this simple image, similar to what I am trying to execute, and has the same error.
FROM alpine:3.7 ENV HTTP_PROXY http://my_user: my_pass@company _proxy:3128 ENV HTTPS_PROXY https://my_user: my_pass@company _proxy:3128 RUN apk add --no-cache curl CMD ["curl","-v","--tlsv1","https://www.docker.io/"]
Built with
$ docker build --network host --rm -t test/alpine:curl .
Work without --network host .
$ docker run --rm test/alpine:curl % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Could not resolve proxy: company_proxy * Closing connection 0 curl: (5) Could not resolve proxy: company_proxy
Work with --network host .
$ docker run --network host --rm test/alpine:curl % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 10.2.255.0... * TCP_NODELAY set * Connected to company_proxy (10.2.255.0) port 3128 (
I start with Docker and tested this image on two Wi-Fi networks (both without a proxy), the containers worked just fine. Any tips on what might cause this SSL error?
Edit: This is my original problem, I have a multi-stage docker image that runs go code to spin something from firebase.
// main.go package main import ( "os/exec" "os" "log" ) func main() { c := exec.Command("curl","--tlsv1","-kv","-X","PATCH","-d",`{"something" : "something"}`, `https:`); c.Stdout = os.Stdout c.Stderr = os.Stderr err := c.Run() checkerr(err) } func checkerr(err error) { if err != nil{ log.Fatal(err.Error()) panic(err) } }
Original Docker File: