Skip to content

Instantly share code, notes, and snippets.

@akshedu
Last active June 20, 2021 12:51
Show Gist options
  • Save akshedu/159b099cc958fe4224c1d929109cfb4a to your computer and use it in GitHub Desktop.
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
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