You are not logged in.

#1 2023-03-29 02:20:03

pentamassiv
Member
Registered: 2020-07-17
Posts: 11

[SOLVED] docker + systemd-resolved and internet access

Hi,

I followed the Arch Wiki and installed Docker. I can build containers but from withing the containers, I can't access the internet. The following command fails:

docker run curlimages/curl curl archlinux.org

The output is:

Could not resolve host: archlinux.org

However if I start the container with the flags

--dns 127.0.0.53 --network host

, it succeeds. The issue sounds very similar to this question on SO. I also use systemd-resolved. If it is relevant, I have UFW set up too.

My goal is to be able to open a devcontainer in VS Code without any changes and the documentation usually advises against using the

--network host

flag because of the security implications it can have. So my question is:

What do I need to change in order for my containers to have access to the internet and to be able to just pick any dev container and start it without any changes?

Thank you for your time smile

Last edited by pentamassiv (2023-03-30 22:17:05)

Offline

#2 2023-03-30 22:15:32

pentamassiv
Member
Registered: 2020-07-17
Posts: 11

Re: [SOLVED] docker + systemd-resolved and internet access

The solution for me was to remove Docker and install podman.

Offline

Board footer

Powered by FluxBB