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

Added dockerBuildInit option #1438

Merged
merged 3 commits into from
Jul 29, 2021
Merged

Added dockerBuildInit option #1438

merged 3 commits into from
Jul 29, 2021

Conversation

jroper
Copy link
Member

@jroper jroper commented Jul 16, 2021

See #1257.

muuki88
muuki88 previously approved these changes Jul 18, 2021
@@ -152,9 +152,10 @@ object DockerPlugin extends AutoPlugin {
).toOption
.map(_.trim)
.flatMap(DockerApiVersion.parse),
dockerBuildInit := false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can use the dockerVersion or dockerApiVersion to set this true when possible?

Copy link
Member Author

Choose a reason for hiding this comment

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

Possible, however, dockerVersion and dockerApiVersion are task keys. dockerBuildOptions and dockerBuildCommand are setting keys, and so can't depend on dockerVersion or dockerApiVersion. We'd have to depend on this in publishLocal, which I think would be bad because it would mean dockerBuildCommand would no longer be the source of truth as to what was executed.

muuki88
muuki88 previously approved these changes Jul 29, 2021
@@ -68,4 +68,10 @@ private[packager] trait DockerKeysEx extends DockerKeys {
)
val dockerLayerMappings =
taskKey[Seq[LayeredMapping]]("List of layer, source file and destination in Docker image.")
val dockerBuildInit = SettingKey[Boolean](
Copy link
Contributor

Choose a reason for hiding this comment

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

I moved those to the DockerKeysEx, to avoid binary incompatibilities

@muuki88 muuki88 merged commit c871954 into sbt:master Jul 29, 2021
@jroper jroper deleted the docker-build-init branch July 30, 2021 02:35
@guizmaii
Copy link
Contributor

guizmaii commented Aug 31, 2021

Hi,

Tried to activate this new option and rebuilt my image but I get the following error:

[error] unknown flag: --init
[error] See 'docker buildx build --help'.
[info] Removing intermediate image(s) (labeled "snp-multi-stage-id=035fd77f-20c7-432f-ae31-93913656b499") 
[info] Total reclaimed space: 0B
[error] stack trace is suppressed; run last app-embedded-docker / Docker / publishLocal for the full output
[error] (app-embedded-docker / Docker / publishLocal) Nonzero exit value: 125
[error] Total time: 51 s, completed 31 Aug. 2021, 9:57:13 pm

I'm on Mac, is it only available on Linux? 🤔

I have an up-to-date installation of Docker:
Screen Shot 2021-08-31 at 10 00 02 pm

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

Successfully merging this pull request may close these issues.

None yet

3 participants