You are not logged in.

#1 2023-11-03 15:24:08

fermentedplums
Member
Registered: 2022-10-10
Posts: 7

Connection error for yarn inside podman container

I followed the wiki: https://wiki.archlinux.org/title/Podman
and installed the following: podman, podman-docker, podman-compose, podman-dnsname, slirp4netns, netavark, aardvark-dns.

I added to /etc/environment: DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock" and rebooted.

Yet, I am unable to run yarn install inside a container. I get the following error:
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.7.2.tgz: getaddrinfo EAI_AGAIN registry.yarnpkg.com registry.yarnpkg.com:443".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Trace:
  Error: getaddrinfo EAI_AGAIN registry.yarnpkg.com registry.yarnpkg.com:443
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)

Am I missing something? Is there some package that is needed for this to work?
If I try the same on the nixos machine with podman, yarn install just works and all I had to do is add the following:

  virtualisation = {
    podman = {
      enable = true;

      # Create a `docker` alias for podman, to use it as a drop-in replacement
      dockerCompat = true;

      # Required for containers under podman-compose to be able to talk to each other.
      defaultNetwork.settings.dns_enabled = true;
    };
  };

and rebuild the system.

If I uninstall podman and follow the docker wiki page and install it, yarn install works as it should.

Last edited by fermentedplums (2023-11-03 15:30:33)

Offline

#2 2023-11-06 16:43:20

fermentedplums
Member
Registered: 2022-10-10
Posts: 7

Re: Connection error for yarn inside podman container

I was able to find out the a solution to the problem by trying to downgrade podman package to the version debian uses (v4.3.1)
I also tried the prior versions of the current v4.7.2 and the problem was introduced since v4.4.3.
Version 4.4.2 works fine.

Offline

#3 2023-11-22 08:42:02

fermentedplums
Member
Registered: 2022-10-10
Posts: 7

Re: Connection error for yarn inside podman container

Ok, so I've been able to narrow it down a bit more, at least in terms of how to reproduce the error.

1. Create a Dockerfile with the following contents:

FROM alpine:3.18.4
RUN apk add --no-cache git yarn
RUN git clone https://github.com/seanpmaxwell/express-generator-typescript.git
ENTRYPOINT [ "/bin/sh" ]

2. Create a docker-compose.yml with the following contents:

services:

  test:
    build:
      context: .
    container_name: test
    tty: true
    stdin_open: true

3. Run podman-compose up -d
4. Run podman exec -it test sh
5. Run cd express-generator-typescript && yarn install

Offline

#4 2023-11-23 05:56:46

Toolybird
Member
Registered: 2017-09-30
Posts: 90

Re: Connection error for yarn inside podman container

Just following up from your bug tracker issue: https://bugs.archlinux.org/task/80267

The error is due to DNS not working inside the container (just ping any domain name and it will fail). To get it working I had to install both "aardvark-dns" and "podman-dnsname".

It seems there is room for improvement in both the Wiki docs and the optional deps description.

Last edited by Toolybird (2023-11-23 05:57:59)

Offline

Board footer

Powered by FluxBB