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

Disable DOCKER_BUILDKIT #135

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Disable DOCKER_BUILDKIT #135

merged 1 commit into from
Oct 15, 2023

Conversation

whoan
Copy link
Owner

@whoan whoan commented Oct 15, 2023

Closes #131

@whoan whoan merged commit c70dd4f into master Oct 15, 2023
4 checks passed
@ajaest
Copy link

ajaest commented Oct 17, 2023

With this change you have unadvertly broken all our builds in our company, relying in buildkit. I think using buildkit is legit (and needed to use things like "--mount").

@whoan
Copy link
Owner Author

whoan commented Oct 17, 2023

@ajaest I am sorry to read that. To avoid that in the future, you should always stick to a specific version. eg: v6.0.0.

Edits in bold:
DOCKER_BUILDKIT had actually broken this action for multi-stage builds as the action relies on the old docker build output to do its job. With DOCKER_BUILDKIT enabled, it just rebuilds intermediate stages every time. ie: It only affects multi-stage builds.

If time allows it, I will look for ways to make this action to work even with DOCKER_BUILDKIT enabled, but for the moment, you can just use a previous version of the action, but again, with DOCKER_BUILDKIT enabled, it just rebuilds again.

@smuuf
Copy link

smuuf commented Oct 18, 2023

To avoid that in the future, you should always stick to a specific version. eg: v6.0.0.

I'm not sure if v6.0.0 is supposed to be exactly the same as v6.0, but it seems that the Disable BUILDKIT unfeature is present even in v6.0 (and we've been using the fixed v6.0 version for more than half a year now and for us the problem manifested itself just today).

obrazek

https://github.com/whoan/docker-build-with-cache-action/releases/tag/v6.0


Edit: It seems that the version ˙˙v6.0.0˙ indeed doesn't contain this change (while v6.0 does).

@milandufek
Copy link

Moreover the fix cannot be changed even from ENV variable because the script always override the settings. There would be much more better to put something like that.

export DOCKER_BUILDKIT=${DOCKER_BUILDKIT:-0}

To allow users to enable it if they want but keep it disabled by default.

@whoan
Copy link
Owner Author

whoan commented Oct 18, 2023

I am aware of your concerns guys. I will do my best to fix the action for you. Just patience that I am doing this in my free time just for love.
Anyways, AFAIK, if you enable DOCKER_BUILDKIT again, the action will just build but without using the cache, which was the main purpose for it.
Regards.

@whoan
Copy link
Owner Author

whoan commented Oct 20, 2023

FYI v4.2.2, v5.11.3, v6.0.2, and v7.0.1 allow to set DOCKER_BUILDKIT variable. By default, it's DOCKER_BUILDKIT=0.

I plan to eventually default to DOCKER_BUILDKIT=1. See issue #138 for more information.

@ajaest
Copy link

ajaest commented Oct 20, 2023

Thanks @whoan, as you suggested I pinned version to v5.11.3 and now it is working again. It is true that caching is not working with DOCKER_BUILDKIT=1, but we didn't realize. Anyways, at least the build works and we are not in a hurry.

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

Successfully merging this pull request may close these issues.

build stages not being pushed
4 participants