summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/images_build.go
diff options
context:
space:
mode:
authorAnanth Bhaskararaman <antsub@gmail.com>2021-10-25 23:35:11 +0530
committerAnanth Bhaskararaman <antsub@gmail.com>2021-12-14 21:08:31 +0530
commit52b12fe98599625a862b6298c654233ce1ae1bbe (patch)
tree49353b5d2eeb97a80ce91d0d3fea473d1a5a3ad9 /pkg/api/handlers/compat/images_build.go
parent4a060caeabc7061b85a290ba31f87af7d4dbf508 (diff)
downloadpodman-52b12fe98599625a862b6298c654233ce1ae1bbe.tar.gz
podman-52b12fe98599625a862b6298c654233ce1ae1bbe.tar.bz2
podman-52b12fe98599625a862b6298c654233ce1ae1bbe.zip
Fixes #12063 Add docker compatible output after image build.
Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
Diffstat (limited to 'pkg/api/handlers/compat/images_build.go')
-rw-r--r--pkg/api/handlers/compat/images_build.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go
index a665be4fb..45e4543a9 100644
--- a/pkg/api/handlers/compat/images_build.go
+++ b/pkg/api/handlers/compat/images_build.go
@@ -621,7 +621,8 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
Stream string `json:"stream,omitempty"`
Error *jsonmessage.JSONError `json:"errorDetail,omitempty"`
// NOTE: `error` is being deprecated check https://github.com/moby/moby/blob/master/pkg/jsonmessage/jsonmessage.go#L148
- ErrorMessage string `json:"error,omitempty"` // deprecate this slowly
+ ErrorMessage string `json:"error,omitempty"` // deprecate this slowly
+ Aux json.RawMessage `json:"aux,omitempty"`
}{}
select {
@@ -656,6 +657,11 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
case <-runCtx.Done():
if success {
if !utils.IsLibpodRequest(r) && !query.Quiet {
+ m.Aux = []byte(fmt.Sprintf(`{"ID":"sha256:%s"}`, imageID))
+ if err := enc.Encode(m); err != nil {
+ logrus.Warnf("failed to json encode error %v", err)
+ }
+ m.Aux = nil
m.Stream = fmt.Sprintf("Successfully built %12.12s\n", imageID)
if err := enc.Encode(m); err != nil {
logrus.Warnf("Failed to json encode error %v", err)