Java Magazine, May/June 2019
ORACLE COM JAVAMAGAZINE MAY JUNE 2019 19 containers container in it and a service that makes it available externally Notice the service uses an app by the same name as the deployments app label Note the image name in the deployment specification calls for your local image name helidon quickstart se When you deploy this in Kubernetes the runtime will look for this image locally first You are using a local image in that Docker is running on your local machine But the issue is that Minikube is running its own instance of Docker locally in its virtual machine The image you built earlier will not be found there Minikube has a handy solution for this issue the docker env command This command prints a set of shell environment variables that will direct a Docker client to use the Docker server where Minikube is running Simply invoke this command inside an eval on Linux UNIX or Mac consult the documentation for the Windows equivalent and it will set the variables in your current shell environment eval minikube docker env Now when you invoke the docker client it will connect to Docker running in the Minikube virtual machine Note that this will be configured only in your current shell session its not a permanent change Now you can build the image as you did above but this time it will be built in Minikubes virtual machine and the resulting image will be local to it docker build t helidon quickstart se target Sending build context to Docker daemon 5877MB Step 1 5 FROM openjdk 8 jre slim 8 jre slim Pulling from library openjdk f7e2b70d04ae Pull complete 05d40fc3cf34 Pull complete b235bdb95dc9 Pull complete 9a9ecf5ba38f Pull complete 91327716c461 Pull complete
You must have JavaScript enabled to view digital editions.