Skip to content

feat: add support for 'domainname' option in container create #3885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

swagatbora90
Copy link
Contributor

@swagatbora90 swagatbora90 commented Feb 14, 2025

Adds support for --domainname in container create and run.

A domainname fied has been added to the OCI spec and runc has added support for it.

This field should set mainly set the NIS domain name of the container. Though, docker is currently using the domainname option to also set the FQDN in /etc/hosts. I have tried to preserve the same behavior, since some users may choose to pass a unqualified hostname and the domain name separately, instead of passing the full FQDN in the hostname.

Testing:

dev-dsk-sbora-2c-038007b3 % sudo nerdctl run -it --hostname myhost --domainname example.com ubuntu  domainname
example.com

(25-02-14 19:49:14) <0> [~/nerdctl]  
dev-dsk-sbora-2c-038007b3 % sudo nerdctl run -it --hostname myhost --domainname example.com ubuntu hostname
myhost

(25-02-14 19:49:19) <0> [~/nerdctl]  
dev-dsk-sbora-2c-038007b3 % sudo nerdctl run -it --hostname myhost --domainname example.com ubuntu hostname -f
myhost.example.com

(25-02-14 19:49:22) <0> [~/nerdctl]  
dev-dsk-sbora-2c-038007b3 % sudo nerdctl run -it --hostname myhost --domainname example.com ubuntu hostname --nis
example.com

Closes: #1772

@swagatbora90 swagatbora90 force-pushed the add-domainname-option branch 4 times, most recently from e441d93 to e36a273 Compare February 16, 2025 19:43
@swagatbora90 swagatbora90 marked this pull request as ready for review February 16, 2025 20:47
@AkihiroSuda AkihiroSuda added this to the v2.x.x (tentative) milestone Feb 18, 2025
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 87cc074 into containerd:main Feb 18, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement domainname flag for run
2 participants