Ultimately trying to build a docker container based on alpine. Using wsl+docker desktop on Windows.
It looks like the container cannot make https calls. e.g.
C:Usersmedevfoodemo-app>docker run -it amazoncorretto:21-alpine /bin/sh
/ # apk update
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.19/main: Permission denied
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.19/community: Permission denied
fetch https://apk.corretto.aws/x86_64/APKINDEX.tar.gz
WARNING: updating and opening https://apk.corretto.aws: could not connect to server (check repositories file)
6 unavailable, 0 stale; 17 distinct packages available
/ #
I can fetch this w/curl from within windows itself.
C:Usersmedevfoodemo-app>curl -o windows_cmd.tgz https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 456k 100 456k 0 0 728k 0 --:--:-- --:--:-- --:--:-- 732k
Inside of the default linux distro, I have set environment vars for http proxy, and also copied/installed the ZScaler certificate, and it works.
C:Usersmedevfoodemo-app>bash
me@USDSCWN34136453:/mnt/c/Users/me/dev/foo/demo-app$ curl -o wsl_bash.tgz https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 456k 100 456k 0 0 1040k 0 --:--:-- --:--:-- --:--:-- 1039k
I assume that the docker-run container does not know about the ZScaler cert, and is ok in terms of dns and proxies. It’s hard to tell though as alpine doesn’t come with nice things like curl by default.
Assuming it’s the certificate, how do I get windows-docker to pass that on to the container? If you don’t think it’s the certificate, what suggestions do you have?