@@ -78,7 +78,7 @@ delete =
78
78
79
79
## EXAMPLES
80
80
81
- Create the specified secret based on local file.
81
+ Create the specified secret based on a local file.
82
82
```
83
83
echo -n mysecret > ./secret.txt
84
84
$ podman secret create my_secret ./secret.txt
@@ -89,7 +89,17 @@ Create the specified secret via stdin.
89
89
$ printf <secret> | podman secret create my_secret -
90
90
```
91
91
92
- Create gpg encrypted secret based on local file using the pass driver.
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 a 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
+
102
+ Create gpg encrypted secret based on a local file using the pass driver.
93
103
```
94
104
$ podman secret create --driver=pass my_secret ./secret.txt.gpg
95
105
```
@@ -100,8 +110,9 @@ $ podman secret create --env=true my_secret MYSECRET
100
110
```
101
111
102
112
## 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 ) **
104
114
105
115
## HISTORY
106
- January 2021, Originally compiled by Ashley Cui
< [email protected] >
107
- February 2024, Added example showing secret creation from an environment variable by Brett Calliss
< [email protected] >
116
+ * January 2021, Originally compiled by Ashley Cui
< [email protected] >
117
+ * February 2024, Added example showing secret creation from an environment variable by Brett Calliss
< [email protected] >
118
+ * May 2025, Added example showing secure secret generation / rotation & mounting by [ Stuart Cardall] ( https://github.com/itoffshore )
0 commit comments