Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow building without pushing #144

Closed
mikebryant opened this issue Apr 25, 2018 · 9 comments
Closed

Allow building without pushing #144

mikebryant opened this issue Apr 25, 2018 · 9 comments
Assignees

Comments

@mikebryant
Copy link

Context

When using tooling like Gitlab-CI, we want to be able to run the build process pre-merge, in order to validate changes

Problem

kaniko doesn't appear to allow you to run just the build without also needing credentials to push to a registry.

Solution

Allow for just the build process to run, without specifying a destination to push to.

@mikebryant
Copy link
Author

m@hotppc17686:~/tmp/kaniko$ cat Dockerfile 
FROM library/busybox:latest
m@hotppc17686:~/tmp/kaniko$ docker run -it --rm -v ${PWD}:/workspace gcr.io/kaniko-project/executor:latest
INFO[0000] Unpacking filesystem of library/busybox:latest... 
INFO[0000] Whitelisted directories are [/kaniko /proc /dev /dev/pts /sys /sys/fs/cgroup /sys/fs/cgroup/systemd /sys/fs/cgroup/rdma /sys/fs/cgroup/net_cls,net_prio /sys/fs/cgroup/freezer /sys/fs/cgroup/memory /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/devices /sys/fs/cgroup/cpuset /sys/fs/cgroup/perf_event /sys/fs/cgroup/blkio /sys/fs/cgroup/hugetlb /sys/fs/cgroup/pids /dev/mqueue /workspace /etc/resolv.conf /etc/hostname /etc/hosts /dev/shm /dev/console /proc/asound /proc/bus /proc/fs /proc/irq /proc/sys /proc/sysrq-trigger /proc/kcore /proc/timer_list /proc/sched_debug /sys/firmware] 
INFO[0004] Initializing source image library/busybox:latest 
ERRO[0010] invalid reference format                     
m@hotppc17686:~/tmp/kaniko$ docker build .
Sending build context to Docker daemon 2.048 kB
Step 1/1 : FROM library/busybox:latest
 ---> 5b0d59026729
Successfully built 5b0d59026729
m@hotppc17686:~/tmp/kaniko$ 

@dlorenc
Copy link
Contributor

dlorenc commented Apr 25, 2018

This basically just drops the image after it's been built, as a way to validate the build "succeeds"?

@mikebryant
Copy link
Author

@dlorenc yup. It validates that the Dockerfile syntax is correct and so on, prior to merge.

@mikebryant
Copy link
Author

mikebryant commented Apr 25, 2018

Alternatively if the build and push steps were separate commands that would be great too

@dlorenc
Copy link
Contributor

dlorenc commented Apr 27, 2018

We'll tackle this by adding a flag to output a tarball on disk, which is useful for other cases as well.

@dlorenc
Copy link
Contributor

dlorenc commented May 16, 2018

This should be fixed now. You can run with a --tar-path=/dev/null and it will skip the push.

@dlorenc dlorenc closed this as completed May 16, 2018
@smrutimandal
Copy link

For the ones late to the party like me, add --no-push to the list of arguments.

docker run -it --rm -v ${PWD}:/workspace gcr.io/kaniko-project/executor:latest --no-push

@abdennour
Copy link

thank you @smrutimandal ! you saved my month

@DavidAntliff
Copy link

DavidAntliff commented Jan 19, 2022

The --no-push option also requires the --cache-repo option, presumably as the --destination option is no longer required, and possibly even ignored if specified?

On the other hand, with the --tar-path option (which is now --tarPath), kaniko still makes use of the cache implied by --destination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants