<p>i'm new to openshift/kubernetes/docker and i was wondering where the docker registry of openshift origin persist the images , knowing that :</p>

<p><em>1.in the deployment's yaml of the docker registry , there is only emptyDir volumes declaration</em></p>

<pre><code>  volumes:
    - emptyDir: {}
      name: registry-storage
</code></pre>

<p><em>2.in the machine where the pod is deployed i can't see no volume using</em> </p>

<pre><code>docker volumes ls
</code></pre>

<p><em>3.the images are still persisted even if i restart the pod</em></p>

<p>docker registry deployment's yaml :</p>

<pre><code>apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  creationTimestamp: '2020-04-26T18:16:50Z'
  generation: 1
  labels:
    docker-registry: default
  name: docker-registry
  namespace: default
  resourceVersion: '1844231'
  selfLink: &gt;-
    /apis/apps.openshift.io/v1/namespaces/default/deploymentconfigs/docker-registry
  uid: 1983153d-87ea-11ea-a4bc-fa163ee581f7
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    docker-registry: default
  strategy:
    activeDeadlineSeconds: 21600
    resources: {}
    rollingParams:
      intervalSeconds: 1
      maxSurge: 25%
      maxUnavailable: 25%
      timeoutSeconds: 600
      updatePeriodSeconds: 1
    type: Rolling
  template:
    metadata:
      creationTimestamp: null
      labels:
        docker-registry: default
    spec:
      containers:
        - env:
            - name: REGISTRY_HTTP_ADDR
              value: ':5000'
            - name: REGISTRY_HTTP_NET
              value: tcp
            - name: REGISTRY_HTTP_SECRET
              value: 
            - name: REGISTRY_MIDDLEWARE_REPOSITORY_OPENSHIFT_ENFORCEQUOTA
              value: 'false'
            - name: OPENSHIFT_DEFAULT_REGISTRY
              value: 'docker-registry.default.svc:5000'
            - name: REGISTRY_HTTP_TLS_CERTIFICATE
              value: /etc/secrets/registry.crt
            - name: REGISTRY_OPENSHIFT_SERVER_ADDR
              value: 'docker-registry.default.svc:5000'
            - name: REGISTRY_HTTP_TLS_KEY
              value: /etc/secrets/registry.key
          image: 'docker.io/openshift/origin-docker-registry:v3.11'
          imagePullPolicy: IfNotPresent
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 5000
              scheme: HTTPS
            initialDelaySeconds: 10
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 5
          name: registry
          ports:
            - containerPort: 5000
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 5000
              scheme: HTTPS
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 5
          resources:
            requests:
              cpu: 100m
              memory: 256Mi
          securityContext:
            privileged: false
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /registry
              name: registry-storage
            - mountPath: /etc/secrets
              name: registry-certificates
      dnsPolicy: ClusterFirst
      nodeSelector:
        node-role.kubernetes.io/infra: 'true'
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: registry
      serviceAccountName: registry
      terminationGracePeriodSeconds: 30
      volumes:
        - emptyDir: {}
          name: registry-storage
        - name: registry-certificates
          secret:
            defaultMode: 420
            secretName: registry-certificates
  test: false
  triggers:
    - type: ConfigChange
status:
  availableReplicas: 1
  conditions:
    - lastTransitionTime: '2020-04-26T18:17:12Z'
      lastUpdateTime: '2020-04-26T18:17:12Z'
      message: replication controller "docker-registry-1" successfully rolled out
      reason: NewReplicationControllerAvailable
      status: 'True'
      type: Progressing
    - lastTransitionTime: '2020-05-05T09:39:57Z'
      lastUpdateTime: '2020-05-05T09:39:57Z'
      message: Deployment config has minimum availability.
      status: 'True'
      type: Available
  details:
    causes:
      - type: ConfigChange
    message: config change
  latestVersion: 1
  observedGeneration: 1
  readyReplicas: 1
  replicas: 1
  unavailableReplicas: 0
  updatedReplicas: 1
</code></pre>

<p>to restart : i just delete the pod and a new one is created since i'm using a deployment</p>

<p>i'm creating the file in the /registry </p>

AMAR BESSALAH
<p>Restarting does not mean the data is deleted, it still exist in the container top layer, suggest you get started by <a href="https://docs.docker.com/storage/storagedriver/" rel="nofollow noreferrer">reading this</a>.</p>

<p>Persistence is, for example in Kubernetes, when a pod is deleted and re-created on another node and still maintains the same state of a volume.</p>
