Only local connections are allowed (Circle CI beginner question)

#!/bin/bash -eo pipefail
chromedriver --url-base=/wd/hub

Starting ChromeDriver 2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706) on port 9515
Only local connections are allowed.
[1623037436.616][SEVERE]: bind() returned an error, errno=99: Cannot assign requested address (99)

I am new to Circle CI, CI/CD in general, so I tried to install everything into the container following these instructions: How to Setup Selenium with ChromeDriver on Ubuntu 18.04 & 16.04 – TecAdmin

I can run the tests locally but get that error on Circle CI with my config.yml below:

version: 2.1

  # The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files
  # Orb commands and jobs help you with common scripting around a language/tool
  # so you dont have to copy and paste it everywhere.
  # See the orb documentation here:
  python: circleci/python@1.2

  sample:  # This is the name of the workflow, feel free to change it to better match your workflow.
    # Inside the workflow, you define the jobs you want to run. 
    # For more details on extending your workflow, see the configuration docs: 
      - build-and-test

  build-and-test:  # This is the name of the job, feel free to change it to better match what you're trying to do!
    # These next lines defines a Docker executors:
    # You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub
    # A list of available CircleCI Docker convenience images are available here:
    # The executor is the environment in which the steps below will be executed - below will use a python 3.9 container
    # Change the version below to your required version of python
      - image: cimg/python:3.8
    # Checkout the code as the first step. This is a dedicated CircleCI step.
    # The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default.
    # Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt.
    # Then run your tests!
    # CircleCI will report the results back to your VCS provider.
      - checkout
      - python/install-packages:
          pkg-manager: pip
          # app-dir: ~/project/package-directory/  # If you're requirements.txt isn't in the root directory.
          # pip-dependency-file: test-requirements.txt  # if you have a different name for your requirements file, maybe one that combines your runtime and test requirements.
      # install java, chrome, chrome driver
      - run: sudo apt-get update
      - run: sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4
      - run: sudo apt-get install default-jdk
      # Google Chrome
      - run: sudo curl -sS -o - | sudo apt-key add
      #- run: echo "deb [arch=amd64] stable main" >> sudo tee /etc/apt/sources.list.d/google-chrome.list
      - run: sudo sh -c "echo 'deb stable main' >>   /etc/apt/sources.list"
      - run: sudo apt-get -y update
      - run: sudo apt-get -y install google-chrome-stable
      # install Chrome Driver
      - run: wget
      - run: unzip
      - run: sudo mv chromedriver /usr/bin/chromedriver
      - run: sudo chown root:root /usr/bin/chromedriver
      - run: sudo chmod +x /usr/bin/chromedriver
      # download required Jar Files
      - run:
          name: Download Selenium
          command: wget
      - run: wget
      - run: unzip

      - run:
          name: Run Chrome via Selenium Server
          command: xvfb-run java -jar selenium-server-standalone-3.13.0.jar
          background: true
      - run:
          name: Start Headless ChromeDriver
          command: chromedriver --url-base=/wd/hub
      - run:
          name: Run Dash tests
          # This assumes pytest is installed via the install-package step above
          command: pytest

I am going to try using the circleci/python:3.6.2-stretch-browsers as shown here: 2.0 Project Tutorial - CircleCI but last time it said /bin/bash no command java so I will install java this time but that seemed strange for it not to have Java.

How can I get the above version to work?