aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/spec.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-01-19 08:51:59 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-19 15:42:25 +0000
commita4701b56311d5d934543e2b4306b08baa844ec3f (patch)
treebcad38f7cf02a37107bfa61854a01eb58bf9868f /cmd/podman/spec.go
parent1710acd18a4630ef704c66bf0cdae76dd658776a (diff)
downloadpodman-a4701b56311d5d934543e2b4306b08baa844ec3f.tar.gz
podman-a4701b56311d5d934543e2b4306b08baa844ec3f.tar.bz2
podman-a4701b56311d5d934543e2b4306b08baa844ec3f.zip
Add --dns-search, --dns-opt, --dns-server and --add-host.
Each of these options are destructive in nature, meaning if the user adds one of them, all current ones are removed from the produced resolv.conf. * dns-server allows the user to specify dns servers. * dns-opt allows the user to specify special resolv.conf options * dns-search allows the user to specify search domains The add-host option is not destructive and truly just adds the host to /etc/hosts. Signed-off-by: baude <bbaude@redhat.com> Closes: #231 Approved by: mheon
Diffstat (limited to 'cmd/podman/spec.go')
-rw-r--r--cmd/podman/spec.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmd/podman/spec.go b/cmd/podman/spec.go
index 59ea5685a..152d1740c 100644
--- a/cmd/podman/spec.go
+++ b/cmd/podman/spec.go
@@ -584,6 +584,19 @@ func (c *createConfig) GetContainerCreateOptions() ([]libpod.CtrCreateOption, er
options = append(options, libpod.WithStopSignal(c.StopSignal))
options = append(options, libpod.WithStopTimeout(c.StopTimeout))
+ if len(c.DNSSearch) > 0 {
+ options = append(options, libpod.WithDNSSearch(c.DNSSearch))
+ }
+ if len(c.DNSServers) > 0 {
+ options = append(options, libpod.WithDNS(c.DNSServers))
+ }
+ if len(c.DNSOpt) > 0 {
+ options = append(options, libpod.WithDNSOption(c.DNSOpt))
+ }
+ if len(c.HostAdd) > 0 {
+ options = append(options, libpod.WithHosts(c.HostAdd))
+ }
+
return options, nil
}