'How can I add .net sdk and docker in docker jenkins container

Firstly, I am not DevOps Engineer or Senior developer, I am just a junior developer for four months and a sophomore in the software world. We are using CentOS 7 and I created Jenkins as a container on Docker. But I have tried to dotnet command on Jenkins but I faced some errors "dotnet not found". After that, I tried to create Dockerfile in order to install .net SDK to the Jenkins container. I have found some examples and used this Dockerfile . But I faced some errors again. By the way, I am using my company computer.

W: Failed to fetch http://deb.debian.org/debian/dists/bullseye/InRelease  Cannot initiate the connection to debian.map.fastlydns.net:80 (2a04:4e42:41::644). - connect (101: Network is unreachable) Could not connect to debian.map.fastlydns.net:80 (199.232.18.132), connection timed out 
Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:41::644). - connect (101: Network is unreachable) Could not connect to deb.debian.org:80 (151.101.14.132), connection timed out
W: Failed to fetch http://security.debian.org/debian-security/dists/bullseye-security/InRelease  Cannot initiate the connection to debian.map.fastlydns.net:80 (2a04:4e42:41::644). - connect (101: Network is unreachable) Could not connect to debian.map.fastlydns.net:80 (199.232.18.132), connection timed out 
Cannot initiate the connection to security.debian.org:80 (2a04:4e42:400::644). - connect (101: Network is unreachable) 
Cannot initiate the connection to security.debian.org:80 (2a04:4e42:600::644). - connect (101: Network is unreachable)
 Cannot initiate the connection to security.debian.org:80 (2a04:4e42::644). - connect (101: Network is unreachable) 
Cannot initiate the connection to security.debian.org:80 (2a04:4e42:200::644). - connect (101: Network is unreachable) Could not connect to security.debian.org:80 (151.101.2.132), connection timed out 
Could not connect to security.debian.org:80 (151.101.130.132), connection timed out Could not connect to security.debian.org:80 (151.101.66.132), 
connection timed out Could not connect to security.debian.org:80 (151.101.194.132), connection timed out
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease  Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:41::644). - connect (101: Network is unreachable)
W: Some index files failed to download. 
They have been ignored, or old ones used instead.
E: Package 'gnupg2' has no installation candidate
E: Unable to locate package software-properties-common

I have searched on Google in order to solve this problem and find some solution like adding proxy and I have added our proxy an tried again. But I faced some errors again

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to (my proxy adress)
gpg: no valid OpenPGP data found.

Now, I am about to go crazy I can not find any solution.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source