#! /bin/bash # In this example, we: # 1. create a temporary local registry # 2. build a new docker image using kaniko # 3. push the image on the local registry # 4. pull the image from the local registry # Create local registry docker run -d --name registry --publish 5000:5000 registry:2 sleep 10 curl 10.6.193.11:5000/v2/_catalog # Build image docker run -v "$(pwd)":/workspace gcr.io/kaniko-project/executor:latest \ --context=/workspace/ \ --dockerfile /workspace/Dockerfile \ --destination 10.6.193.11:5000/toto:titi # Test image presence on registry curl 10.6.193.11:5000/v2/_catalog # Pull image using 127.0.0.1 to avoid insecure registry error docker pull 127.0.0.1:5000/toto:titi # Remove the registry docker rm -f registry