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

Add dockerBuildEnvVars setting, fix docker test failure in CI #1594

Merged
merged 3 commits into from
Apr 10, 2024

Conversation

dwickern
Copy link
Collaborator

@dwickern dwickern commented Apr 9, 2024

Docker BuildKit became the default in Docker v23.0 which caused the test to fail. BuildKit doesn't expose intermediate containers as images, so the cleanup setting dockerAutoremoveMultiStageIntermediateImages is not relevant when running BuildKit.

I've added a setting dockerBuildEnvVars which can be used to disable BuildKit:

dockerBuildEnvVars += "DOCKER_BUILDKIT" -> "0"

I've also improved BuildKit detection-- it now checks the docker version if DOCKER_BUILDKIT is not set.

This incidentally fixes #1518

@dwickern dwickern force-pushed the fix-docker-test branch 3 times, most recently from ebfa780 to f8dfe5a Compare April 9, 2024 22:47
@dwickern dwickern changed the title fix docker test failure in CI Add dockerBuildEnvVars setting, fix docker test failure in CI Apr 10, 2024
dockerBuildEnvVars.value
.get("DOCKER_BUILDKIT")
.orElse(sys.env.get("DOCKER_BUILDKIT"))
.map(_ == "1")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker uses strconv.ParseBool which accepts some other values, but we'll assume the value is either 1 or 0.

@dwickern dwickern requested a review from muuki88 April 10, 2024 16:26
Copy link
Contributor

@muuki88 muuki88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 😎 thanks a lot

@muuki88 muuki88 merged commit 37fcec3 into sbt:master Apr 10, 2024
15 checks passed
@dwickern dwickern deleted the fix-docker-test branch April 10, 2024 19:53
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.

Option to enable Docker buildkit
2 participants