aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/common/netflags.go13
-rwxr-xr-xcontrib/cirrus/runner.sh4
-rw-r--r--docs/source/markdown/podman-images.1.md27
-rw-r--r--pkg/rootless/rootless_linux.go26
-rw-r--r--test/system/500-networking.bats10
5 files changed, 55 insertions, 25 deletions
diff --git a/cmd/podman/common/netflags.go b/cmd/podman/common/netflags.go
index e7aa265d1..90f05ab15 100644
--- a/cmd/podman/common/netflags.go
+++ b/cmd/podman/common/netflags.go
@@ -39,6 +39,11 @@ func DefineNetFlags(cmd *cobra.Command) {
"Set custom DNS options",
)
_ = cmd.RegisterFlagCompletionFunc(dnsOptFlagName, completion.AutocompleteNone)
+ netFlags.StringSlice(
+ "dns-option", containerConfig.DNSOptions(),
+ "Docker compatibility option== --dns-opt",
+ )
+ _ = netFlags.MarkHidden("dns-option")
dnsSearchFlagName := "dns-search"
netFlags.StringSlice(
@@ -146,6 +151,14 @@ func NetFlagsToNetOptions(opts *entities.NetOptions, flags pflag.FlagSet) (*enti
opts.DNSOptions = options
}
+ if flags.Changed("dns-option") {
+ options, err := flags.GetStringSlice("dns-option")
+ if err != nil {
+ return nil, err
+ }
+ opts.DNSOptions = append(opts.DNSOptions, options...)
+ }
+
if flags.Changed("dns-search") {
dnsSearches, err := flags.GetStringSlice("dns-search")
if err != nil {
diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh
index 35ecfd4ff..6b2d123f2 100755
--- a/contrib/cirrus/runner.sh
+++ b/contrib/cirrus/runner.sh
@@ -398,9 +398,7 @@ dotest() {
}
_run_machine() {
- # TODO: This is a manually-triggered task, if that ever changes need to
- # add something like:
- # _bail_if_test_can_be_skipped docs test/e2e test/system test/python
+ # N/B: Can't use _bail_if_test_can_be_skipped here b/c content isn't under test/
make localmachine |& logformatter
}
diff --git a/docs/source/markdown/podman-images.1.md b/docs/source/markdown/podman-images.1.md
index 923b22f1b..d005db23d 100644
--- a/docs/source/markdown/podman-images.1.md
+++ b/docs/source/markdown/podman-images.1.md
@@ -4,11 +4,11 @@
podman\-images - List images in local storage
## SYNOPSIS
-**podman images** [*options*]
+**podman images** [*options*] [image]
-**podman image list** [*options*]
+**podman image list** [*options*] [image]
-**podman image ls** [*options*]
+**podman image ls** [*options*] [image]
## DESCRIPTION
Displays locally stored images, their names, and their IDs.
@@ -107,15 +107,22 @@ Sort by *created*, *id*, *repository*, *size* or *tag* (default: **created**)
## EXAMPLE
```
-# podman images
-REPOSITORY TAG IMAGE ID CREATED SIZE
-docker.io/kubernetes/pause latest e3d42bcaf643 3 years ago 251 kB
-<none> <none> ebb91b73692b 4 weeks ago 27.2 MB
-docker.io/library/ubuntu latest 4526339ae51c 6 weeks ago 126 MB
+$ podman images
+REPOSITORY TAG IMAGE ID CREATED SIZE
+quay.io/podman/stable latest e0b7dabc3352 22 hours ago 331 MB
+docker.io/library/alpine latest 9c6f07244728 5 days ago 5.83 MB
+registry.fedoraproject.org/fedora latest 2ecb6df95994 3 weeks ago 169 MB
+quay.io/libpod/testimage 20220615 f26aa69bb3f3 2 months ago 8.4 MB
+```
+
+```
+$ podman images stable
+REPOSITORY TAG IMAGE ID CREATED SIZE
+quay.io/podman/stable latest e0b7dabc3352 22 hours ago 331 MB
```
```
-# podman images --quiet
+# podman image ls --quiet
e3d42bcaf643
ebb91b73692b
4526339ae51c
@@ -129,7 +136,7 @@ docker.io/library/ubuntu latest 4526339ae51c 6 weeks ago
```
```
-# podman images --no-trunc
+# podman image list --no-trunc
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/kubernetes/pause latest sha256:e3d42bcaf643097dd1bb0385658ae8cbe100a80f773555c44690d22c25d16b27 3 years ago 251 kB
<none> <none> sha256:ebb91b73692bd27890685846412ae338d13552165eacf7fcd5f139bfa9c2d6d9 4 weeks ago 27.2 MB
diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go
index b0012b32b..8c4316dbb 100644
--- a/pkg/rootless/rootless_linux.go
+++ b/pkg/rootless/rootless_linux.go
@@ -251,20 +251,22 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
return false, 0, nil
}
- if mounts, err := pmount.GetMounts(); err == nil {
- for _, m := range mounts {
- if m.Mountpoint == "/" {
- isShared := false
- for _, o := range strings.Split(m.Optional, ",") {
- if strings.HasPrefix(o, "shared:") {
- isShared = true
- break
+ if _, inContainer := os.LookupEnv("container"); !inContainer {
+ if mounts, err := pmount.GetMounts(); err == nil {
+ for _, m := range mounts {
+ if m.Mountpoint == "/" {
+ isShared := false
+ for _, o := range strings.Split(m.Optional, ",") {
+ if strings.HasPrefix(o, "shared:") {
+ isShared = true
+ break
+ }
}
+ if !isShared {
+ logrus.Warningf("%q is not a shared mount, this could cause issues or missing mounts with rootless containers", m.Mountpoint)
+ }
+ break
}
- if !isShared {
- logrus.Warningf("%q is not a shared mount, this could cause issues or missing mounts with rootless containers", m.Mountpoint)
- }
- break
}
}
}
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index b9a173c2a..5da7523f3 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -767,4 +767,14 @@ EOF
is "$output" "" "Should print no output"
}
+@test "podman network rm --dns-option " {
+ dns_opt=dns$(random_string)
+ run_podman run --rm --dns-opt=${dns_opt} $IMAGE cat /etc/resolv.conf
+ is "$output" ".*options ${dns_opt}" "--dns-opt was added"
+
+ dns_opt=dns$(random_string)
+ run_podman run --rm --dns-option=${dns_opt} $IMAGE cat /etc/resolv.conf
+ is "$output" ".*options ${dns_opt}" "--dns-option was added"
+}
+
# vim: filetype=sh