question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microk8s should expose the docker agent to allow for local builds

See original GitHub issue

Hi all,

Microk8s should expose the docker agent to allow for local container builds using the daemon included inside the snap, I.E:

microk8s.docker build .
microk8s.docker login someregistry.catloverextreme.com

Etc.

Cheers,

  • Calvin

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
davefinstercommented, Jul 18, 2018

Can confirm this works for at least getting the Docker client talking to the internal daemon. Worth pointing out though that another slash is required

> docker -H unix:///var/snap/microk8s/current/docker.sock ps
root@other-k8s:/var/snap/microk8s/current# docker -H unix:///var/snap/microk8s/current/docker.sock ps
CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS               NAMES
fedf8c9eb0e9        6c0dbeaa8d20                  "/pod_nanny --config…"   6 minutes ago       Up 6 minutes                            k8s_eventer-nanny_heapster-v1.5.2-577898ddbf-m868v_kube-system_0e11103f-8a47-11e8-9183-42010a800002_1

whereas without the additional /:

> docker -H unix://var/snap/microk8s/current/docker.sock ps
Cannot connect to the Docker daemon at unix://var/snap/microk8s/current/docker.sock. Is the docker daemon running?

Additionally one can use export DOCKER_HOST=unix:///var/snap/microk8s/current/docker.sock to avoid the -H argument on each command. It might also be worth doing sudo usermod -aG docker <username> (the socket should belong to group ‘docker’) so you don’t have to be root.

1reaction
ktsakalozoscommented, Aug 13, 2018

In the edge and 1.11/edge channels you will now find the microk8s.docker command. This addition came in with the registry addon (microk8s.enable registry) that start an insecure registry at localhost:32000. Have a look here: https://github.com/ubuntu/microk8s/blob/master/docs/registry.md

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microk8s should expose the docker agent to allow for local ...
Hi all, Microk8s should expose the docker agent to allow for local container builds using the daemon included inside the snap, ...
Read more >
How to use the built-in registry - MicroK8s
The registry shipped with MicroK8s is hosted within the Kubernetes cluster and is exposed as a NodePort service on port 32000 of the...
Read more >
Build apps locally and Deploy on MicroK8s | by Hari Manikkothu
This article explains different ways to build container locally and deploy it on a MicroK8s cluster in a development environment.
Read more >
How to use the built-in registry - microk8s - Discuss Kubernetes
Having a private Docker registry can significantly improve your productivity by reducing the time spent in uploading and downloading Docker ...
Read more >
Deploying Kubernetes Locally – MicroK8s - Ubuntu
Registry: Deploy a Docker private registry and expose it on localhost:32000. The storage add-on will be enabled as part of this. All of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found