<p>Based on the <a href="https://github.com/benc-uk/kubeview" rel="nofollow noreferrer"><strong>KubeView</strong> README</a>, I tried to run <strong>KubeView</strong> using the container provided <a href="https://github.com/users/benc-uk/packages/container/package/kubeview" rel="nofollow noreferrer">here</a>.</p>
<p>I run:</p>
<pre><code>$ docker run --publish-all --name kubeview ghcr.io/benc-uk/kubeview:0.1.31
</code></pre>
<p>I get the following output:</p>
<pre><code>2023/03/12 18:06:45 ### Kubeview v0.1.31 starting...
2023/03/12 18:06:45 ### Connecting to Kubernetes...
2023/03/12 18:06:45 ### Creating client with config file: /.kube/config
panic: stat /.kube/config: no such file or directory

goroutine 1 [running]:
main.main()
    /build/cmd/server/main.go:60 +0x6a5
</code></pre>
<p>I can see that the problem is that the tool is looking for the kubeconfig file in <code>/.kube/config</code>. It can't find it because mine is in my home directory, <code>~/.kube/config/</code></p>
<p>I tried to pass an environment variable like this:</p>
<pre><code>$ docker run --publish-all --name kubeview -e KUBECONFIG=/Users/&lt;MY_USERNAME&gt;/.kube/config ghcr.io/benc-uk/kubeview:latest
</code></pre>
<p>It didn't work. Has anyone been able to run <code>KubeView</code> as a container? I'm on a Mac.</p>

Shant Dashjian
<p>You can <strong>mount</strong> your local <strong>kubeconfig</strong> file to the <strong>Docker</strong> image that you are trying, not sure if the way you follow <strong>Env variable</strong> option is suggested anywhere or not</p>
<p>Try something like :</p>
<pre><code>docker run --publish-all --name kubeview -v ./config:/.kube/config ghcr.io/benc-uk/kubeview:0.1.31
</code></pre>
<p><strong>./config</strong> - will the path of your <code>~/.kube/config/</code> <strong>local system</strong></p>
<p><strong>/.kube/config</strong> - path where your local file will get set in the container, so when container will run your local file will be available at that path</p>
<p>Tried with <strong>fake</strong> values, which not able to parse but it got the file</p>
<pre><code>2023/03/12 19:28:04 ### Kubeview v0.0.0 starting...
2023/03/12 19:28:04 ### Connecting to Kubernetes...
2023/03/12 19:28:04 ### Creating client with config file: /.kube/config
panic: error loading config file &quot;/.kube/config&quot;: couldn't get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct { APIVersion string &quot;json:\&quot;apiVersion,omitempty\&quot;&quot;; Kind string &quot;json:\&quot;kind,omitempty\&quot;&quot; }

goroutine 1 [running]:
main.main()
        /build/cmd/server/main.go:60 +0x6a5
</code></pre>
