I was creating my own development env with docker this is my docker file
FROM alpine:latest
WORKDIR /app
RUN apk update
RUN apk upgrade
RUN reboot
RUN apk add --no-cache make
RUN apk add
RUN git config --global user.name "username"
RUN git config --global user.email "email"
RUN git config --global init.defaultBranch main
RUN export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
RUN reboot
and one more thing in my original file I have given proper username and email for the git config
now I created image out of this Dockerfile with
docker build -t xyz .
created a container using
docker run --rm -it -v %cd%:/app xyz sh
but the problem comes when I try to clone a directory
git clone https://github.com/coder/code-server.git
the error I get
Cloning into 'code-server'...
fatal: unable to access 'https://github.com/coder/code-server.git/': Could not resolve host: github.com
is this problem from the docker networking part (do I have to define DNS manually ..?) enter image description here and my internet is working perfectly and I can ping google.com but not github.com enter image description here
the things I have tried to solve this problem
git config --global --unset https.proxy (used this) (didn't work) git config --global --unset http.proxy (used this) (didn't work) tried to use ssh still didn't work (using openssh-client) (i installed openssh-client on the alpine) and I more thing I have tried to clone the repo on other folders also (other than the mounted folder /app)
I was expecting that the container can reach the github.com