Unfortunately you did not provide microk8 version and your steps.
I supposed that you used sudo snap install microk8s --classic
command to install. Currently it will download v1.14.0.
You can check your version using snap info microk8s
Version 1.14.0 introduced changes in microk8s.daemon-docker and change it to microk8s.daemon-containerd. Due to this change microk8s cannot execute docker commands. Microk8s contains daemon-docker between versions 1.11 and 1.13.
If you are used to use docker install microk8s v1.13 by sudo snap install microk8s --classic --channel=1.13/stable
For future use:
1) Install microk8s - sudo snap install microk8s --classic --channel=1.13/stable
(if still want use docker)
2) Make sure that microk8s is started - microk8s.start
(you can stop it by microk8s.stop
)
3) Check what services are running by - microk8s.inspect
4) Commands in microk8s differs prefix, i.e instead of
- kubectl get all --all-namespaces
you need to use microk8s.kubectl get all --all-namespaces
(later you can use allias to chage it)
5) You can create image via Dockerfile using microk8s.docker build .
(don't forget to have Dockerfile and "." on the end of the command).
You can always check Microk8s documentation