sbt-native-packager
sbt-native-packager copied to clipboard
sbt docker:publishLocal logs build info as error
Expected behaviour
sbt docker:publishLocal builds the docker image and logs the status as info
Actual behaviour
sbt docker:publishLocal build the docker image successfully, but the logs are logged as error and that makes things confusing.
[success] All package validations passed
[error] #0 building with "default" instance using docker driver
[error] #1 [internal] load .dockerignore
[error] #1 transferring context: 2B done
[error] #1 DONE 0.0s
[error] #2 [internal] load build definition from Dockerfile
[error] #2 transferring dockerfile: 795B done
[error] #2 DONE 0.0s
[error] #3 [internal] load metadata for docker.io/library/openjdk:11
[error] #3 DONE 0.8s
[error] #4 [1/7] FROM docker.io/library/openjdk:11@sha256:99bac5bf83633e3c7399aed725c8415e7b569b54e03e4599e580fc9cdb7c21ab
[error] #4 DONE 0.0s
[error] #5 [internal] load build context
[error] #5 transferring context: 33.02kB done
[error] #5 DONE 0.0s
Information
- What sbt-native-packager are you using - 1.9.16
- What sbt version - 1.8.2
- What is your build system (e.g. Ubuntu, MacOS, Windows, Debian ) - Ubuntu
- What package are you building (e.g. docker, rpm, ...) - docker
- What version has your build tool (find out with e.g.
rpm --version) - Docker version 24.0.5, build ced0996 - What is your target system (e.g. Ubuntu 16.04, CentOS 7) - Ubuntu 20.04
I have the same issue after installing docker-buildx on my machine.
My current workaround for this issue is to add the --quiet flag to the docker build options. This will prevent the diagnostic output from being printed at all.
dockerBuildOptions += "--quiet"
[success] All package validations passed
[info] sha256:54d8d84c8d77ce6442d3fe6171edd77cfb974dd74dd447013b680a2cff512b1d
[info] Removing intermediate image(s) (labeled "snp-multi-stage-id=1fa46be6-0387-41d5-b1ec-67902cd00ffc")
[info] Total reclaimed space: 0B
[info] Built image <redacted> with tags [0.28.0, latest]
[success] Total time: 21 s, completed Oct 31, 2023, 1:36:19 PM
Also see https://github.com/moby/buildkit/issues/1186