Packer: An image does not exist locally with the tag: sha256

Created on 17 Oct 2016  路  5Comments  路  Source: hashicorp/packer

The docker image was built and tagged successfully, but when attempting to push the image, it appears the tag referenced, was incorrect. The image was tagged successfully with 0.1.1, but according to the output, the tag was sha256:566caa5be3007b5a04552fdde8313dab0c3514702d5840afaae54b1ef8826cf8, which Packer misread (?) as sha256 when attempting to push. I was able to perform a docker push separately on the image, so the image was tagged just fine.

docker-tag section:

"post-processors": [
  {
    "type": "docker-tag",
    "repository": "garystafford/ubuntu-tomcat",
    "tag": "0.1.1"
  },

Output:

==> docker: Committing the container
    docker: Image ID: sha256:566caa5be3007b5a04552fdde8313dab0c3514702d5840afaae54b1ef8826cf8
==> docker: Killing the container: 74c9912d1875611f10fb11f3e365984f5bb90b66df1570108bff4c68834fe878
==> docker: Running post-processor: docker-tag
    docker (docker-tag): Tagging image: sha256:566caa5be3007b5a04552fdde8313dab0c3514702d5840afaae54b1ef8826cf8
    docker (docker-tag): Repository: garystafford/ubuntu-tomcat:0.1.1
==> docker: Running post-processor: docker-push
    docker (docker-push): Logging in...
    docker (docker-push): Login Succeeded
    docker (docker-push): Pushing: sha256:566caa5be3007b5a04552fdde8313dab0c3514702d5840afaae54b1ef8826cf8
    docker (docker-push): The push refers to a repository [docker.io/library/sha256]
    docker (docker-push): An image does not exist locally with the tag: sha256
    docker (docker-push): Logging out...
    docker (docker-push): Remove login credentials for https://index.docker.io/v1/

I am running Packer 0.10.2 on Mac 10.11.6. Docker version:

Client:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.7.1
 Git commit:   6f9534c
 Built:        Thu Sep 15 11:20:26 2016
 OS/Arch:      darwin/amd64
 Experimental: true

Server:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 17:52:38 2016
 OS/Arch:      linux/amd64
bug buildedocker waiting-reply

Most helpful comment

Could this be the same issue as #3297?

Do you mind showing us your entire post-processors section?

All 5 comments

Docker version?

Docker version added above.

Could this be the same issue as #3297?

Do you mind showing us your entire post-processors section?

Yes, that's exactly what the problem was - missing brackets. After adding, the container built, tagged, and push successfully. I would've never contributed that error to the missing brackets. Thank you.

glad we got it fixed. Will have to think if we can make the cause more obvious

Was this page helpful?
0 / 5 - 0 ratings