Comments (6)
Yes, I got it working by installing Docker Desktop which setup /var/run/docker.sock
. That is a workaround, though. Docker Desktop should not be a requirement for the Packer docker-push post-processor, as it is not for the builder or other post-processors. docker-push should correctly ascertain and use the active Docker endpoint based on the Docker context.
from packer-plugin-docker.
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.
from packer-plugin-docker.
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.
from packer-plugin-docker.
This might be a Mac specific problem. I just noticed that there is more than one context with Docker Desktop:
NAME DESCRIPTION DOCKER ENDPOINT ERROR
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock
desktop-linux * Docker Desktop unix:///Users/wawrzek/.docker/run/docker.sock
and Rancher Desktop has own:
rancher-desktop Rancher Desktop moby context unix:///Users/wawrzek/.rd/docker.sock
I'll check @smaddock your suggestion to set DOCKER_CONTEXT
.
from packer-plugin-docker.
After setting the DOCKER_CONTEXT
I see now a different error:
docker.eigenlayer (docker-push): Failed to initialize: unable to resolve docker endpoint: context "desktop-linux": context not found: open /var/folders/l4/0bhk3tfj2dqg60yp93c7dtl00000gn/T/packer1747910882/contexts/meta/fe9c6bd7a66301f49ca9b6a70b217107cd1284598bfc254700c989b916da791e/meta.json: no such file or directory
docker.eigenlayer (docker-push): Removing temporary Docker configuration directory
from packer-plugin-docker.
During further investigation, I fixed the default context in Docker Desktop. In my case it was pointing ad the socket from Rancher Desktop which was broken. I deleted '/var/run/docker.sock', disabled and then re-enabled Allow the default Docker socket to be used (requires password)
option in the Docker Desktop Advance Settings. Default context (builder in Docker Desktop) was fixed, and then I can run packer normally.
I suggest anyone with the problem to check if /var/run/docker.sock
is valid and enabled in Docker Desktop.
from packer-plugin-docker.
Related Issues (20)
- Parallel Docker pushes still failing due to credentials being removed HOT 3
- Unable to push to ECR private repo in 1.0.7 HOT 5
- ECR Login fails in Packer 1.8.3 HOT 5
- No meaningful error even in debug mode when Docker Desktop (WSL2) is not running HOT 2
- /bin/sh: 1: /home/ubuntu/packer/script_2501.sh: Permission denied
- simple docker build changing CMD and ENTRYPOINT of resulting image HOT 2
- Packer should remove /packer-files mount point
- PowerShell at Windows container ignores errors
- Building images in parallel and pushing them to Docker Hub results in premature logout HOT 1
- docker-push doesn't push to Private repository. HOT 4
- HCL2 example of "windows_container": true uses ubuntu image HOT 2
- Packer's docker plugin metadata change for Env does require equal sign and cannot extend env vars in hcl2 variant language
- Packer docker builder reseting ENTRYPOINT and CMD
- error with provisioning scripts in docker HOT 4
- Question template in the issue is out of date HOT 1
- Docker-push post processer ecr_login assume role support
- Build docker image in parallel and credentials are removed before all images are push to ECR HOT 2
- Workaround for #8120: "Unable to use packer with distroless base images"
- Support `--platform` docker CLI argument to target the image architecture to be produced. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packer-plugin-docker.