1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/creating-pull-secrets.adoc
2025-03-20 18:12:29 +00:00

40 lines
1.2 KiB
Plaintext

// Module included in the following assemblies:
// * openshift_images/using-image-pull-secrets
// * openshift_images/managing-image-streams.adoc
:_mod-docs-content-type: PROCEDURE
[id="creating-pull-secret_{context}"]
= Creating a pull secret
.Procedure
* Create a secret from an existing authentication file:
** For Docker clients using `.docker/config.json`, enter the following command:
+
[source,terminal]
----
$ oc create secret generic <pull_secret_name> \
--from-file=.dockerconfigjson=<path/to/.docker/config.json> \
--type=kubernetes.io/dockerconfigjson
----
** For Podman clients using `.config/containers/auth.json`, enter the following command:
+
[source,terminal]
----
$ oc create secret generic <pull_secret_name> \
--from-file=<path/to/.config/containers/auth.json> \
--type=kubernetes.io/podmanconfigjson
----
* If you do not already have a Docker credentials file for the secured registry, you can create a secret by running the following command:
+
[source,terminal]
----
$ oc create secret docker-registry <pull_secret_name> \
--docker-server=<registry_server> \
--docker-username=<user_name> \
--docker-password=<password> \
--docker-email=<email>
----