Open jammymalina opened 1 year ago
Just running into this myself, although I don't think it's specific to ECR. Rather it seems to be that docker-push
does not respect the Docker context set nor have a way to specify the Docker context, and only uses the default
context. Colima (and other container runtimes) specify alternate contexts as can be seen by running docker context ls
. Example:
❯ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT
colima * colima unix:///Users/smaddock/.colima/default/docker.sock
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock
This is why docker push
works manually but the post processor does not. Note that this is a different issue than running Packer on a remote host... the host is still local; the socket is just in an alternate location.
Documentation: https://docs.docker.com/engine/context/working-with-contexts/
If we could set the DOCKER_CONTEXT
environment variable, or the --context
command-line argument like we can with run_command
on the builder, that would work.
Hi Packer Docker plugin team, I observed this peculiar issue.
Overview of the Issue
Post-processor docker-push fails when it tries to push an image to the ECR. Both build and login were successful. If I try to push the docker image manually (doing docker push myself) it succeeds.
Reproduction Steps
Run packer build
Plugin and Packer version
From
packer version 1.8.3
andplugin version 1.0.8
Simplified Packer Buildfile
Operating system and Environment details
macOS Monterey 12.6, Darwin 21.6.0 Darwin Kernel Version 21.6.0, Docker with Colima VM
Log Fragments and crash.log files