https://pantsbuild.org/ logo
#general
Title
# general
t

thousands-plumber-33255

07/11/2022, 4:11 PM
How can I publish my Docker image using the
registries
field to another container? I.e. I am running pants from a container that is in the same network as my localstack container. I can access it with
localstack
as the host and not
localhost
. But with
Copy code
registries=[
        "localstack:4510",
    ],
It is trying to reach Get
<https://localstack:4510/v2/>": dial tcp: lookup localstack on 192.168.65.5:53: no such host
c

curved-television-6568

07/11/2022, 4:23 PM
What would your
docker push
command look like?
t

thousands-plumber-33255

07/11/2022, 5:32 PM
Well good question! I see that you are just calling
docker push
in the end. I really am wondering how the serverless plugin then can publish from docker-in-docker when an image is selected as target. Because that works as expected.
c

curved-television-6568

07/11/2022, 5:38 PM
🤷
t

thousands-plumber-33255

07/11/2022, 5:39 PM
Will figure it out 👀 Sorry for this not pants related issue
c

curved-television-6568

07/11/2022, 5:41 PM
Np. Normally I would've taken the opportunity to learn more about aws and lambdas etc, and maybe found some insights along the way.. :)
t

thousands-plumber-33255

07/11/2022, 5:41 PM
Will let you know once I have figured out how this is achieved
🙏 1
👍 1
So the requirements translate to
docker push localstack:4510/repo1
(see here). It seems that by default localhost is insecure registry. In the end I solved it adding "insecure-registries" : ["host.docker.internal:4510"] so that with the following I was able to publish my image to localstack with pants:
Copy code
registries=[
        "host.docker.internal:4510",
    ],
👍 1
6 Views