From 95412ee3241bdde51ec2d729fa24016257d898c7 Mon Sep 17 00:00:00 2001 From: wanderer Date: Fri, 20 Aug 2021 13:14:31 +0200 Subject: [PATCH] feat: upgrade to a cgroupv2-aware kaniko (#1) since commit https://github.com/GoogleContainerTools/kaniko/commit/b22e9932246cd191d63b1fc8f98c1d8372c6c445, kaniko is cgroupv2-aware. hotfix of https://git.dotya.ml/wanderer/drone-kaniko/commit/a34e88943a6af8bc9d58237426bcca7a3579f365 is therefore no longer needed. Reviewed-on: https://git.dotya.ml/wanderer/drone-kaniko/pulls/1 Co-authored-by: wanderer Co-committed-by: wanderer --- docker/docker/Dockerfile.linux.amd64 | 2 +- kaniko.go | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/docker/docker/Dockerfile.linux.amd64 b/docker/docker/Dockerfile.linux.amd64 index 9007995..70a77f7 100644 --- a/docker/docker/Dockerfile.linux.amd64 +++ b/docker/docker/Dockerfile.linux.amd64 @@ -1,4 +1,4 @@ -FROM gcr.io/kaniko-project/executor:v1.6.0-debug +FROM gcr.io/kaniko-project/executor@sha256:6ecc43ae139ad8cfa11604b592aaedddcabff8cef469eda303f1fb5afe5e3034 ADD release/linux/amd64/kaniko-docker /kaniko/ ENTRYPOINT ["/kaniko/kaniko-docker"] diff --git a/kaniko.go b/kaniko.go index ce0e125..18c3554 100644 --- a/kaniko.go +++ b/kaniko.go @@ -114,17 +114,6 @@ func (p Plugin) Exec() error { cmdArgs = append(cmdArgs, fmt.Sprintf("--no-push")) } } - // due to kaniko spontaneously failing to detect it's being run in a container - // it's probably for the better to always force-run here until this is resolved - // and fixed upstream. Since all of our runners are on cgroup v2 hosts, this - // issue is quite impactful for us. - // ref: https://github.com/GoogleContainerTools/kaniko/issues/1592 - // - // example error message: '/kaniko/executor --dockerfile=Dockerfile --context=dir://. - // --no-push kaniko should only be run inside of a container, run with the --force - // flag if you are sure you want to continue' - // another ref: https://drone.dotya.ml/wanderer/docker-archlinux-cdev/5960/2/2 - cmdArgs = append(cmdArgs, fmt.Sprintf("--force")) cmd := exec.Command("/kaniko/executor", cmdArgs...) cmd.Stdout = os.Stdout