Skip to content

Instantly share code, notes, and snippets.

@farbodsalimi
Created June 18, 2020 00:32
Show Gist options
  • Save farbodsalimi/c72265ab533b94b26c97f731af08e665 to your computer and use it in GitHub Desktop.
Save farbodsalimi/c72265ab533b94b26c97f731af08e665 to your computer and use it in GitHub Desktop.

How to run Kaniko locally without k8s:

  1. Go to your project's directory

  2. Tar up the folder:

tar -C . -zcvf context.tar.gz .
  1. Use the newly created context.tar and build an image with kaniko:
docker run \
  -v $(pwd):/workspace \
  gcr.io/kaniko-project/executor:latest \
  --dockerfile /workspace/Dockerfile \
  --context dir:///workspace/ \
  --destination image \
  --tarPath=/workspace/image.tar \
  --no-push
  1. Load the newly created image to your docker daemon:
docker load -i image.tar
  1. Tag the loaded image:
docker tag <IMAGE_ID> your-project-name

Note: Since we've used a tar file to build the image most likely your image's name will be "none".

  1. Run your image:
docker run your-project-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment