Minikube: Pycharm docker integration does not work with vm created using minikube

Created on 14 Sep 2016  路  4Comments  路  Source: kubernetes/minikube

Is this a BUG REPORT or FEATURE REQUEST?

BUG REPORT

Minikube version

minikube version: v0.8.0
Installed from: https://aur.archlinux.org/packages/minikube/

Environment

OS

Arch Linux

VM Driver

"DriverName": "virtualbox",
Installed from: https://aur.archlinux.org/packages/virtualbox-ext-oracle/

Docker version

Docker version 1.12.1, build 23cf638
Installed from: https://www.archlinux.org/packages/community/x86_64/docker/

What happened

Minikube does not work with pycharm docker integration.

Pycharm docker integration is useful, because:

  • Debug the code running in the docker image
  • IDE features like code completion based on the exact version of all libraries and code installed in the container.
  • Other languages than python are probably affected as well.

Steps to reproduce:

minikube docker-env

export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/home/kozikow/.minikube/certs"
export DOCKER_API_VERSION="1.23"
# Run this command to configure your shell:
# eval $(minikube docker-env)

Settings in pycharm

  • Settings
  • Project interpreter
  • Gear next to project interpreters
  • Add Remote
  • Docker
  • New

Fill fields in the dialog according to "minikube docker-env":

minikube-images

Dialog is stuck

Afterwards the dialog is stuck on "Getting Remote Interpreter version".

Anything else we should know

Why it's a problem?

  • I need to build images twice, once inside minikube, once on localhost for pycharm.
  • I need to juggle my docker environments while developing locally. It would be nice to just do everything inside minikube environment.

    Nothing in logs

I didn't see anything special in logs (stdout and stderr of ~/pycharm-2016.2/bin/pycharm.sh )

Why is it minikube issue rather than pycharm issue?

Pycharm integration works with docker-machine

Pycharm integration works with the docker image created by the "docker-machine" and ticking the
"Import credentials from docker machine".

Pycharm integration works with localhost

Supply unix:///var/tmp/docker.sock as API-url

Suspected problem

I have seen similar symptoms with pycharm using non-minikube docker.
It was solved after cleaning my images with docker rmi $(docker images -q)

I tried cleaning images inside minikube, but it did not help with my problem.

There are 3 images in minikube that I can't delete:

  • gcr.io/google_containers/kubernetes-dashboard-amd64:v1.1.1
  • gcr.io/google-containers/kube-addon-manager-amd64:v2
  • gcr.io/google_containers/pause-amd64:3.0

I suspect that pycharm have some problem with those images. gcloud docker pull of any of those images on localhost docker could help confirm those suspicions.

kinsupport

Most helpful comment

I encountered a few more bugs on the way, so I wrote a blog post about using pycharm with minikube: https://kozikow.com/2016/09/16/using-pycharm-docker-integration-with-minikube/

All 4 comments

Replacing tcp:// by https:// in the api url works.

For reference, setup that worked for me:

minikube docker-env:

export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/home/kozikow/.minikube/certs"
export DOCKER_API_VERSION="1.23"
# Run this command to configure your shell:
# eval $(minikube docker-env)

working_minikube

I encountered a few more bugs on the way, so I wrote a blog post about using pycharm with minikube: https://kozikow.com/2016/09/16/using-pycharm-docker-integration-with-minikube/

@kozikow glad you got it to work - and awesome blog post, thanks!

Was this page helpful?
0 / 5 - 0 ratings