hashicorp / packer-plugin-docker

Packer plugin for Docker Builder
https://www.packer.io/docs/builders/docker
Mozilla Public License 2.0
30 stars 26 forks source link

Unable to push to repository due to "manifest invalid" error. #28

Open ghost opened 3 years ago

ghost commented 3 years ago

This issue was originally opened by @madelaney as hashicorp/packer#10879. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


When filing a bug, please include the following headings if possible. Any example text in this template can be deleted.

Overview of the Issue

We have a number of packer configuration files (json), that builds a container but when we try to push to our internal registry we get an error of: docker (docker-push): manifest invalid: manifest invalid.

Reproduction Steps

Just run packer build <gist file> on Mac OS (Big Sur). I tried to reproduce this on Linux (Ubuntu 18.04) using Packer 1.7.2 and I could not but a coworker could reproduce this on another Mac OS (Big Sur) machiune.

Packer version

Tested with Packer 1.7.2, 1.6.0, and 1.5.6.

Simplified Packer Buildfile

A sample json file has been placed here

Operating system and Environment details

Mac OS X (amd64), Big Sur (11.2.2)

Log Fragments and crash.log files

From our internal registry (Artifactory) we see this in the logs:

2021-04-07T12:04:18.575Z [jfrt ] [WARN ] [7b02eb14f7c5ddb6] [.r.ArtifactoryResponseBase:125] [-nio-8081-exec-14780] - Sending HTTP error code 400: Property key: docker.label.desktop.docker.io/binds/0/SourceKind is invalid due to Name must start with a letter and cannot contain whitespace or special characters
2021-04-07T12:04:18.577Z [jfrt ] [ERROR] [7b02eb14f7c5ddb6] [h.DockerManifestPutHandler:261] [-nio-8081-exec-14780] - Error uploading manifest: 'Property key: docker.label.desktop.docker.io/binds/0/SourceKind is invalid due to Name must start with a letter and cannot contain whitespace or special characters'

From the packer run we see this:

    docker (docker-push): e5307c768962: Preparing
    docker (docker-push): fa728254b20e: Preparing
    docker (docker-push): 33a48e9ca2ba: Preparing
    docker (docker-push): 8aad4316c1e3: Preparing
    docker (docker-push): 9f7793952dca: Preparing
    docker (docker-push): 2bb84c5f5766: Preparing
    docker (docker-push): 8ea3b23f387b: Preparing
    docker (docker-push): 2bb84c5f5766: Waiting
    docker (docker-push): 8ea3b23f387b: Waiting
    docker (docker-push): 8aad4316c1e3: Layer already exists
    docker (docker-push): 33a48e9ca2ba: Layer already exists
    docker (docker-push): 9f7793952dca: Layer already exists
    docker (docker-push): fa728254b20e: Layer already exists
    docker (docker-push): 2bb84c5f5766: Layer already exists
    docker (docker-push): 8ea3b23f387b: Layer already exists
    docker (docker-push): e5307c768962: Pushed
    docker (docker-push): manifest invalid: manifest invalid
2021/04/07 08:05:58 packer-post-processor-docker-push plugin: error: Bad exit status: 1
2021/04/07 08:05:58 [INFO] (telemetry) ending docker-push

* Post-processor failed: Bad exit status: 1
==> Wait completed after 10 seconds 179 milliseconds
2021/04/07 08:05:58 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
Build 'docker' errored after 10 seconds 178 milliseconds: 1 error(s) occurred:
2021/04/07 08:05:58 machine readable: docker,error []string{"1 error(s) occurred:\n\n* Post-processor failed: Bad exit status: 1"}

* Post-processor failed: Bad exit status: 1
==> Builds finished but no artifacts were created.
2021/04/07 08:05:58 [INFO] (telemetry) Finalizing.
* Post-processor failed: Bad exit status: 1

==> Wait completed after 10 seconds 179 milliseconds