Merge pull request #7547 from medyagh/docs_push_img_typos

site: add hot tips for pushing images
pull/7587/head^2
Medya Ghazizadeh 2020-04-10 04:24:44 -07:00 committed by GitHub
commit 4b3f1e5169
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 17 deletions

View File

@ -39,29 +39,38 @@ To point your terminal to use the docker daemon inside minikube run this:
eval $(minikube docker-env) eval $(minikube docker-env)
``` ```
now any 'docker' command you run in this current terminal will run against the docker inside minikube VM or Container. now any 'docker' command you run in this current terminal will run against the docker inside minikube cluster.
Try it:
so if you do the following commands, it will show you the containers inside the minikube inside minikube's VM or Container.
```shell ```shell
docker ps docker ps
``` ```
now you 'build' against the docker inside minikube. which is instantly accessible to kubernetes cluster. now you can 'build' against the docker inside minikube. which is instantly accessible to kubernetes cluster.
''' ```shell
docker build -t myimage . docker build -t my_image .
''' ```
Remember to turn off the `imagePullPolicy:Always` (use `imagePullPolicy:IfNotPresent` or `imagePullPolicy:Never`), as otherwise Kubernetes won't use images you built locally. To verify your terminal is using minikuber's docker-env you can check the value of the environment variable MINIKUBE_ACTIVE_DOCKERD to reflect the cluster name.
{{% pageinfo %}} {{% pageinfo color="info" %}}
Evaluating the docker-env is only valid for the current terminal. Tip 1:
and by closing the terminal, you will go back to using your own system's docker daemon. Remember to turn off the `imagePullPolicy:Always` (use `imagePullPolicy:IfNotPresent` or `imagePullPolicy:Never`) in your yaml file.otherwise Kubernetes won't use your locally build image and it will pull from the network.
{{% /pageinfo %}}
in some drivers such as Docker or Podman, you will need to re-do docker-env each time you restart your minikube.
{{% pageinfo color="info" %}}
Tip 2:
Evaluating the docker-env is only valid for the current terminal.
and by closing the terminal, you will go back to using your own system's docker daemon.
{{% /pageinfo %}}
{{% pageinfo color="info" %}}
Tip 3:
In container-based drivers such as Docker or Podman, you will need to re-do docker-env each time you restart your minikube cluster.
{{% /pageinfo %}} {{% /pageinfo %}}
To verify your terminal is using minikuber's docker-env you can check the value of the environment variable MINIKUBE_ACTIVE_DOCKERD to reflect the profile name.
more information on [docker-env](https://minikube.sigs.k8s.io/docs/commands/docker-env/) more information on [docker-env](https://minikube.sigs.k8s.io/docs/commands/docker-env/)
@ -77,15 +86,23 @@ minikube cache add alpine:latest
The add command will store the requested image to `$MINIKUBE_HOME/cache/images`, and load it into the minikube cluster's container runtime environment automatically. The add command will store the requested image to `$MINIKUBE_HOME/cache/images`, and load it into the minikube cluster's container runtime environment automatically.
{{% pageinfo %}} {{% pageinfo color="info" %}}
if your image changes after your cached it, you could do `cache reload` to ensure minikube gets the last updates. Tip 1 :
If your image changes after your cached it, you need to do 'cache reload'.
{{% /pageinfo %}}
```
shell minikube refreshes the cache images on each start. however to reload all the cached images on demand run this command :
```shell
minikube cache reload minikube cache reload
``` ```
{{% pageinfo color="info" %}}
Tip 2 :
if you have multiple cluster, cache command will load the image for all of them.
{{% /pageinfo %}} {{% /pageinfo %}}
To display images you have added to the cache: To display images you have added to the cache:
```shell ```shell
@ -108,6 +125,7 @@ For more information, see:
## 3. Pushing directly to in-cluster CRIO. (podman-env) ## 3. Pushing directly to in-cluster CRIO. (podman-env)
This is simmilar to docker-env but only for cri-o runtime.
To push directly to CRIO, configure podman client on your mac/linux host using the podman-env command in your shell: To push directly to CRIO, configure podman client on your mac/linux host using the podman-env command in your shell:
```shell ```shell