Last active
June 20, 2021 12:51
-
-
Save akshedu/159b099cc958fe4224c1d929109cfb4a to your computer and use it in GitHub Desktop.
Create an image which can run k8s commands and push it to ECR
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
stages: | |
- build | |
build_k8s: | |
stage: build | |
when: manual | |
image: | |
name: gcr.io/kaniko-project/executor:debug | |
entrypoint: ["/busybox/sh"] | |
script: | |
- mkdir -p /kaniko/.docker | |
- echo "{\"credsStore\":\"ecr-login\"}" > /kaniko/.docker/config.json | |
- /kaniko/executor --context $CI_PROJECT_DIR/k8s/ --dockerfile $CI_PROJECT_DIR/k8s/Dockerfile --destination 123456789123.dkr.ecr.ap-south-1.amazonaws.com/k8s:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment