When I run skaffold run on CircleCI with the image of gcr.io/k8s-skaffold/skaffold, following error occurs.
tagPolicy:
gitCommit: {}
Error is
WARN[0000] Unable to find git commit: starting command &{git [git describe --tags --always] [] ../ <nil> 0xc0000f6720 0xc0000f6730 [] <nil> <nil> <nil> <nil> 0xc000809940 false [] [0xc0000f6720 0xc0000f6730] [0xc0000f6718 0xc0000f6728] [] <nil> <nil>}: exec: "git": executable file not found in $PATH
tagPolicy:
dateTime:
timezone: "Asia/Tokyo"
Error is
Generating tags...
- gcr.io/{project}/{imagename} -> FATA[0000] generating tag: generating tag for gcr.io/{project}/{imagename}: bad timezone provided: "Asia/Tokyo", error: open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory
Exited with code 1
I guess the cause is required files/command are not in built docker image.
https://github.com/GoogleContainerTools/skaffold/blob/master/deploy/skaffold/Dockerfile
tagPolicy: gitCommit / dateTime should work correctly even if using docker image
dirtyapiVersion: skaffold/v1beta7
kind: Config
build:
artifacts:
- image: gcr.io/{project}/{imagename}
context: ../
tagPolicy:
gitCommit: {}
deploy:
kubectl:
manifests:
- k8s/staging/configmap_nginx_vhost-stg.yml
- k8s/staging/deployment-stg.yml
profiles:
- name: production
build:
tagPolicy:
dateTime:
timezone: "Asia/Tokyo"
deploy:
kubectl:
manifests:
- k8s/production/*
- name: staging
build:
tagPolicy:
dateTime:
timezone: "Asia/Tokyo"
deploy:
kubectl:
manifests:
- k8s/staging/*
docker run -ti --rm -v $PWD:/mnt gcr.io/k8s-skaffold/skaffold /bin/bash -c 'cd /mnt/ && skaffold run -p staging'Thank you for finding this! Yes your analysis seems right - the skaffold image doesn't have the right binaries.
1.) we should add git and the timezone specific files to the image
2.) we should cover this in integration tests
Thank you for the quick response!