I have done the following
Steps to reproduce
Container DNS is not working as expected. The --dns-domain option doesn't seem to do anything, and in order to have a work around, you need to create the config.toml file with a DNS block.
Container was installed with brew. Upgraded to 1.0.0 from an earlier version.
$ container --version
> container CLI version 1.0.0 (build: release, commit: unspeci)
$ which container
> /opt/homebrew/bin/container
To reproduce, first create an internal network:
sudo container system dns create int
container system stop
container system start
Run a container:
container run --rm -it --name test --dns-domain int alpine sh
In the container:
/ # nslookup test.int
Server: 192.168.64.1
Address: 192.168.64.1:53
** server can't find test.int: NXDOMAIN
** server can't find test.int: NXDOMAIN
/ # exit
Create a config.toml file and restart the service:
container system stop
mkdir ~/.config/container/
echo "[dns]" > ~/.config/container/config.toml
echo "domain='int'" >> ~/.config/container/config.toml
container system start
Run the alpine container again:
container run --rm -it --name test --dns-domain int alpine sh
In the container:
/ # nslookup test.int
Server: 192.168.64.1
Address: 192.168.64.1:53
Non-authoritative answer:
Name: test.int
Address: 192.168.64.13
Non-authoritative answer:
Name: test.int
Address: fda5:3940:f4c:788c:f498:adff:fee1:d858
/ # exit
This also works if you remove --dns-domain int from your run command.
Problem description
I expect that DNS resolution should work even if there's no dns.domain section in the config.toml file, if --dns-domain is passed to the run command. It appears not to do anything at all, and the only way to get DNS working is to use config.toml, which limits you to one DNS domain.
It's also worth expanding the help section to indicate what options are possible for --dns-options
Environment
- OS: macOS 26.5.1 (25F80)
- Xcode: n/a
- Container: 1.0.0
Code of Conduct
I have done the following
Steps to reproduce
Container DNS is not working as expected. The
--dns-domainoption doesn't seem to do anything, and in order to have a work around, you need to create the config.toml file with a DNS block.Container was installed with brew. Upgraded to 1.0.0 from an earlier version.
To reproduce, first create an internal network:
Run a container:
container run --rm -it --name test --dns-domain int alpine shIn the container:
Create a config.toml file and restart the service:
Run the alpine container again:
container run --rm -it --name test --dns-domain int alpine shIn the container:
This also works if you remove
--dns-domain intfrom your run command.Problem description
I expect that DNS resolution should work even if there's no dns.domain section in the config.toml file, if
--dns-domainis passed to the run command. It appears not to do anything at all, and the only way to get DNS working is to use config.toml, which limits you to one DNS domain.It's also worth expanding the help section to indicate what options are possible for
--dns-optionsEnvironment
Code of Conduct