Skip to content

Instantly share code, notes, and snippets.

@muvaf
Created July 18, 2019 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save muvaf/96da573dfab9cdfbd6d4b02dba5895c4 to your computer and use it in GitHub Desktop.
Save muvaf/96da573dfab9cdfbd6d4b02dba5895c4 to your computer and use it in GitHub Desktop.
Copy images from your local host to minikube cluster
# This is an excerpt from https://github.com/crossplaneio/crossplane/blob/master/cluster/local/minikube.sh
# I think it's pretty useful on its own.
#!/usr/bin/env bash
set -eE
function copy_image_to_cluster() {
local build_image=$1
local final_image=$2
docker save "${build_image}" | (eval "$(minikube docker-env --shell bash)" && docker load && docker tag "${build_image}" "${final_image}")
echo "Copied image ${build_image} to minikube VM as ${final_image}"
}
copy_image_to_cluster alpine:latest alpine:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment