Skip to content

Commit 257e261

Browse files
committed
Update podman-secret-create.1.md
* Adds example showing secure secret generation / rotation & mounting * fixes #26064 Signed-off-by: Stuart Cardall <itoffshore@users.noreply.github.com>
1 parent a2f486f commit 257e261

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

docs/source/markdown/podman-secret-create.1.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ Create the specified secret via stdin.
8989
$ printf <secret> | podman secret create my_secret -
9090
```
9191

92+
Create or rotate a cryptographically secure random secret just under the maximum `512000` bytes via stdin.
93+
```
94+
openssl rand -base64 378000 | podman secret create --replace my_secret -
95+
```
96+
97+
Mount local file based secret securely in a container.
98+
```
99+
podman run --rm --secret source=my_secret,type=mount,uid=1001,gid=1001,mode=440 docker.io/library/alpine ls -l /run/secrets/my_secret
100+
```
101+
92102
Create gpg encrypted secret based on local file using the pass driver.
93103
```
94104
$ podman secret create --driver=pass my_secret ./secret.txt.gpg
@@ -100,8 +110,9 @@ $ podman secret create --env=true my_secret MYSECRET
100110
```
101111

102112
## SEE ALSO
103-
**[podman(1)](podman.1.md)**, **[podman-secret(1)](podman-secret.1.md)**, **[podman-login(1)](podman-login.1.md)**
113+
**[podman(1)](podman.1.md)**, **[podman-secret(1)](podman-secret.1.md)**, **[podman-login(1)](podman-login.1.md)**, **[podman-run(1)](podman-run.1.md)**
104114

105115
## HISTORY
106-
January 2021, Originally compiled by Ashley Cui <acui@redhat.com>
107-
February 2024, Added example showing secret creation from an environment variable by Brett Calliss <brett@obligatory.email>
116+
* January 2021, Originally compiled by Ashley Cui <acui@redhat.com>
117+
* February 2024, Added example showing secret creation from an environment variable by Brett Calliss <brett@obligatory.email>
118+
* May 2025, Added example showing secure secret generation / rotation & mounting by [Stuart Cardall](https://github.com/itoffshore)

0 commit comments

Comments
 (0)