-1

Long time lurker, first time poster so please forgive me if there's some incorrect etiquette in my post.

Here is where everything is currently, I would appreciate some assistance in getting past this failure to build with expo. Dockerfile at the root of the project for react-native.

[dockerfile for react native] (https://i.stack.imgur.com/cFDlk.png)

FROM node:14.13.1-buster-slim

ENV REACT_NATIVE_PACKAGER_HOSTNAME="127.0.0.1"

# default to port 19006 for node
ARG PORT=19006

# install global packages
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH /home/node/.npm-global/bin:$PATH

RUN npx expo start

Docker-compose.yaml file at the root of the project

compose file for docker

 react-native:
build: 
  context: .
  args:
    - NODE_ENV:development
environment:
  NODE_ENV: development
tty: true
working_dir: /app 
volumes:
  - ./ghi/app:/app
ports: 
  - "19006:19006"

and finally the stack trace in the build from the container.

stack trace failure


     [cplcschooltransport-react-native 2/2] RUN npx expo start:
#0 11.21 npm ERR! code EAI_AGAIN
#0 11.21 npm ERR! errno EAI_AGAIN
#0 11.22 npm ERR! request to https://registry.npmjs.org/expo failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
#0 11.23
#0 11.23 npm ERR! A complete log of this run can be found in:
#0 11.23 npm ERR!     /root/.npm/_logs/2023-02-28T18_38_35_202Z-debug.log
#0 11.26 Install for [ 'expo@latest' ] failed with code 1
------
failed to solve: executor failed running [/bin/sh -c npx expo start]: exit code: 1

I'm currently trying to containerize a React Native Expo application, inside of a docker container. My docker yaml file is working correctly for Django and PostgreSQL.

I have to utilize hyper-v for the development domain, and i'm having a very difficult time fixing the EAI_AGAIN error. I've read that it has to do with the proxy for the internet. Here's what i've already one:

  • Verified that my IPsec task offloading box is unchecked on the Hyper-V manager.
  • Attempted to set the packager host name manually to what's displayed on the HOSTS file for Windows and ensured that the Hosts file wasn't missing any information.
  • Altered my Dockerfile and Docker-compose file

My expo was running correctly outside of docker without any errors. My expo was connected to django correctly prior to docker without errors.

I understand this has to do with a DNS lookup timed out error, but i'm having a hard time seeing what i'm missing. Thanks for any assistance!

shelraye
  • 1
  • 1

1 Answers1

-1

It seems like you have a failure in a docker container. I would check your yaml files