# Simulating a customer's internal registry for airgap installs

**URL:** <https://community.replicated.com/t/simulating-a-customers-internal-registry-for-airgap-installs/895>\
**Category:** Packaging an application\
**Created:** [July 28, 2022, 7:51pm UTC](https://community.replicated.com/t/simulating-a-customers-internal-registry-for-airgap-installs/895 "2022-07-28T19:51:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitch](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mitch](https://community.replicated.com/u/Mitch)\
**Post date:** [July 28, 2022, 7:51pm UTC](https://community.replicated.com/t/simulating-a-customers-internal-registry-for-airgap-installs/895/1 "2022-07-28T19:51:58Z")

</div>

I had to wrestle with this configuration and wanted to share. This lets you run a local registry on an Ubuntu 20.04 VM. After you do this procedure, you can disable outbound networking and simulate a totally offline environment for a kots airgap install.

Install docker registry:

```
$ sudo apt update
$ sudo apt install docker-registry

```

We will configure for no security and no TLS. Replace `/etc/docker/registry/config.yml` with this

```nohighlight

version: 0.1
log:
  fields:
    service: registry
storage:
  cache:
    blobdescriptor: inmemory
  filesystem:
    rootdirectory: /var/lib/docker-registry
http:
  addr: :5000
  headers:
    X-Content-Type-Options: [nosniff]
health:
  storagedriver:
    enabled: true
    interval: 10s
    threshold: 3

```

Next, note your hostname, in my case it’s `mitch-deploy-test2`.

Edit `/etc/containerd/config.toml`, commenting out the whole `registry` paragraph that’s already there and put our own, substituting your hostname like this.

```auto
    [plugins."io.containerd.grpc.v1.cri".registry]
      [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
        [plugins."io.containerd.grpc.v1.cri".registry.mirrors."mitch-deploy-test2:5000"]
          endpoint = ["http://mitch-deploy-test2:5000"]
      [plugins."io.containerd.grpc.v1.cri".registry.configs]
        [plugins."io.containerd.grpc.v1.cri".registry.configs."mitch-deploy-test2:5000".tls]
          insecure_skip_verify = true

    # [plugins."io.containerd.grpc.v1.cri".registry]
    # config_path = ""
    # [plugins."io.containerd.grpc.v1.cri".registry.auths]
    # [plugins."io.containerd.grpc.v1.cri".registry.configs]
    # [plugins."io.containerd.grpc.v1.cri".registry.headers]
    # [plugins."io.containerd.grpc.v1.cri".registry.mirrors]

```

Finally restart the registry and containerd.

```nohighlight
$ sudo systemctl restart docker-registry
$ sudo systemctl restart containerd

```

Now we can tell Kots to push airgap images. We provide ANY user/pass to docker login or to kots. Make sure to give the hostname here and NOT localhost, eg:

```nohighlight
$ kubectl kots admin-console push-images kotsadm.tar.gz mitch-deploy-test2:5000 \
    --registry-username xxx --registry-password yyy

$ kubectl kots install your_thing/dev --kotsadm-registry mitch-deploy-test2:5000 \
    --registry-username xxx --registry-password yyy \
    ... etc ...

```

🙂

---

<div class="post-metadata">

**Author:** ![Fernando\_Cremer](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/fernando_cremer/32/436_2.png) [@Fernando\_Cremer](https://community.replicated.com/u/Fernando_Cremer)\
**Post date:** [August 3, 2022, 3:48pm UTC](https://community.replicated.com/t/simulating-a-customers-internal-registry-for-airgap-installs/895/2 "2022-08-03T15:48:26Z")

</div>

Thank you for sharing, this is great! I will need to bookmark this 🙂
