-
-
Save ralphotowo/1a423f00f38c4ece1e4e9bfac68859d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://gist.github.com/627fcfbfbc17a683a70210947e02eaa3 | |
########## | |
# Kaniko # | |
########## | |
open https://github.com/vfarcic/kaniko-demo | |
# Fork it | |
# Replace `[...]` with the GitHub organization or the username | |
export GH_ORG=[...] | |
git clone https://github.com/$GH_ORG/kaniko-demo.git | |
cd kaniko-demo | |
ls -1 | |
cat Dockerfile | |
docker image build \ | |
--tag devops-toolkit \ | |
. | |
minikube start | |
cat docker.yaml | |
kubectl apply \ | |
--filename docker.yaml | |
kubectl wait \ | |
--for condition=containersready \ | |
pod docker | |
kubectl exec -it docker -- sh | |
apk add -U git | |
git clone https://github.com/vfarcic/kaniko-demo.git | |
cd kaniko-demo | |
docker image build \ | |
--tag devops-toolkit \ | |
. | |
exit | |
kubectl delete --filename docker.yaml | |
cat docker-socket.yaml | |
kubectl apply \ | |
--filename docker-socket.yaml | |
kubectl wait \ | |
--for condition=containersready \ | |
pod docker | |
kubectl exec -it docker -- sh | |
apk add -U git | |
git clone https://github.com/vfarcic/kaniko-demo.git | |
cd kaniko-demo | |
docker image build \ | |
--tag devops-toolkit \ | |
. | |
exit | |
kubectl delete \ | |
--filename docker-socket.yaml | |
cat kaniko-git.yaml | |
# Open kaniko-git.yaml | |
# Replace `vfarcic` in `--context` and `--destination` with GitHub and Docker Hub users | |
# Save | |
git add . | |
git commit -m "Changed the registry" | |
git push | |
export REGISTRY_SERVER=https://index.docker.io/v1/ | |
# Replace `[...]` with the registry username | |
export REGISTRY_USER=[...] | |
# Replace `[...]` with the registry password | |
export REGISTRY_PASS=[...] | |
# Replace `[...]` with the registry email | |
export REGISTRY_EMAIL=[...] | |
kubectl create secret \ | |
docker-registry regcred \ | |
--docker-server=$REGISTRY_SERVER \ | |
--docker-username=$REGISTRY_USER \ | |
--docker-password=$REGISTRY_PASS \ | |
--docker-email=$REGISTRY_EMAIL | |
kubectl apply \ | |
--filename kaniko-git.yaml | |
kubectl wait \ | |
--for condition=containersready \ | |
pod kaniko | |
kubectl logs kaniko --follow | |
# Open it in browser | |
cat kaniko-dir.yaml | |
minikube delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment