Update chromedriver image to properly configure user, no longer need "--no-sandbox" option

Created on 23 March 2021, over 3 years ago
Updated 9 May 2024, 8 months ago

Problem/Motivation

When running drupalci/chromedriver, Chromedriver must be launched with --no-sandbox. According to https://developers.google.com/web/updates/2017/04/headless-chrome, this is required in containers unless a user is properly setup.

The DrupalCI image does set up a user, but we still have to run --no-sandbox

DrupalCI Dockerfile

# Add Chrome as a user
RUN groupadd -r chromeuser && useradd -r -g chromeuser -G audio,video chromeuser \
    && mkdir -p /home/chromeuser && chown -R chromeuser:chromeuser /home/chromeuser

Lighthouse Bot Dockerfile (https://github.com/GoogleChromeLabs/lighthousebot/blob/master/builder/Do...)

# Add a chrome user and setup home dir.
RUN groupadd --system chrome && \
    useradd --system --create-home --gid chrome --groups audio,video chrome && \
    mkdir --parents /home/chrome/reports && \
    chown --recursive chrome:chrome /home/chrome

I uncovered this while working on a testing workshop repo: https://github.com/bluehorndigital/drupal-testing-workshop

Specifically in this PR: https://github.com/bluehorndigital/drupal-testing-workshop/pull/2

Steps to reproduce

Run attached to DDEV or Lando and do not set --no-sandbox

Run FunctionalJavscript or Nightwatch tests. Get an error about a socket hangup

Proposed resolution

Copy the steps from Lighthouse Bot to replace current chromeuser setup?

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Component

Miscellaneous Containers

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024