Docker container can't curl, SSL wrong version number Docker container can't curl, SSL wrong version number docker docker

Docker container can't curl, SSL wrong version number


I've edited my question to contain more info about my original problem, oddly the problem still persists in the toy image. So, if someone ever has this problem again this is what solved for me.

The multi stage Dockerfile. It seems both stages need to have access of the proxy envs.

# This image only builds the go binariesFROM golang:1.10-alpine as goalpine-imageARG http_proxyARG https_proxyENV HTTP_PROXY $http_proxyENV HTTPS_PROXY $https_proxy# Build envsENV FULL_PATH /go/src/<project-name>WORKDIR $FULL_PATH# Add the source code:ADD . $FULL_PATH# Build it:RUN cd $FULL_PATH \    && apk update \    && apk add --no-cache curl \    && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/<project-name># This image holds the binaries from the previousFROM alpine:3.7ENV HTTP_PROXY $http_proxyENV HTTPS_PROXY $https_proxyRUN apk update \    && apk add --no-cache bash curl\    && mkdir buildENV WORD_DIR=/buildWORKDIR WORK_DIRCOPY --from=goalpine-image /go/src/<project-name>/bin ./CMD ["./<project-name>"]

Building:

Make sure to set http_proxy and https_proxy as environment variables, mine are in /etc/profile.

docker build --rm --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --network host -t <project-name>:multi-stage .

Running:

docker container run --rm --network host <project-name>:multi-stage