Skip to content

Commit 1b55e39

Browse files
Merge pull request #26083 from itoffshore/secret-create
Update podman-secret-create.1.md
2 parents ce47c99 + d623938 commit 1b55e39

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ delete =
7878

7979
## EXAMPLES
8080

81-
Create the specified secret based on local file.
81+
Create the specified secret based on a local file.
8282
```
8383
echo -n mysecret > ./secret.txt
8484
$ podman secret create my_secret ./secret.txt
@@ -89,7 +89,17 @@ Create the specified secret via stdin.
8989
$ printf <secret> | podman secret create my_secret -
9090
```
9191

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.
93103
```
94104
$ podman secret create --driver=pass my_secret ./secret.txt.gpg
95105
```
@@ -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 <[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

Comments
 (0)