// 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

[role="_abstract"]
To authenticate with container registries in {product-title}, you can create pull secrets from existing Docker or Podman authentication files. You can also create secrets by providing registry credentials directly by using the `oc create secret docker-registry` command.

.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
----

. Optional: 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>
----