Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to start with Missing X server or $DISPLAY error #756

Closed
convers39 opened this issue Sep 27, 2022 · 2 comments
Closed

Failed to start with Missing X server or $DISPLAY error #756

convers39 opened this issue Sep 27, 2022 · 2 comments
Labels

Comments

@convers39
Copy link

convers39 commented Sep 27, 2022

What I am trying to do is to display the test GUI on my host machine, following the post here

Here are docker files.

version: "3.8"
networks:
  default:
services:
  client:
    depends_on:
      - backend
    build:
      context: ./client
    container_name: client
    volumes:
      - ./client:/app
      - ./client/node_modules:/app/node_modules
    ports:
      - "3000:3000"
    restart: always
    env_file:
      - ./client/.env
    networks:
      - default
  backend:
    build:
      context: ./backend
      target: development
    container_name:backend
    volumes:
      - ./backend:/app
      - ./backend/node_modules:/app/node_modules
    ports:
      - "3001:3001"
    restart: always
    env_file:
      - ./backend/.env
    networks:
      - default
  e2e:
    image: cypress
    build: ./e2e
    container_name: cypress
    depends_on:
      - client
      - backend
    environment:
      - CYPRESS_BASE_URL=http://client:3000
      - DISPLAY
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
      - ./e2e/cypress:/app/cypress
      - ./e2e/cypress.config.js:/app/cypress.config.js
    networks:
      - default
FROM cypress/included:10.8.0
WORKDIR /app
# dependencies will be installed only if the package files change
COPY package*.json ./
RUN npm ci
ENTRYPOINT [ "npx", "cypress", "open", "--project", "." ]

Folder structure:

.
├── README.md
├── docker-compose.yaml
├── e2e
├── backend
├── client

When I try to run with an environment variable $DISPLAY, it shows the error below.

IP = 'xxxx'
DISPLAY=$IP:0 docker compose up 

image

If I run without injecting the DISPLAY variable, it does run but not in watch mode, seems it was running as cypress run instead of cypress open.

image

How can I solve this issue?

@MikeMcC399
Copy link
Collaborator

@convers39

This is quite an old post, however it may still be relevant. Could you please let us know if the problem is still open for you or if you resolved it in the meantime? Please also state what your Docker host system is running.

The image cypress/included:10.8.0

docker run -it --rm --entrypoint bash cypress/included:10.8.0 -c "node -v"

shows Node.js v16.14.2 which is no longer supported, so this would need to be retested under a current cypress/included version.

@MikeMcC399 MikeMcC399 added the bug label Jun 8, 2024
@MikeMcC399
Copy link
Collaborator

Closing.
We can re-open if there is new information available.

@MikeMcC399 MikeMcC399 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants