​
DirectorySecurity Advisories
Sign In
Directory
selenium-node-docker logo

selenium-node-docker

Last changed

Sign In for Updates

Get notified of upcoming product changes, critical vulnerability notifications and patches and more.

Sign In
Versions
Overview
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Chainguard Image for selenium

Chainguard Images are regularly-updated, minimal container images with low-to-zero CVEs.

Download this Image

This image is available on cgr.dev:

docker pull cgr.dev/ORGANIZATION/selenium:latest

Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard registry.

Components

Docker Selenium has multiple components which can act as standalone docker images

  1. base
  2. hub
  3. node-docker
  4. node-base
  5. node-chromium
  6. node-firefox
  7. standalone
  8. standalone-docker
  9. standalone-chromium
  10. standalone-firefox
  11. event-bus
  12. distributor
  13. router
  14. session-queue
  15. sessions

Usage

Run the container with the following command:

docker run --shm-size="2g" -p 4444:4444 -p 7900:7900 cgr.dev/chainguard/docker-selenium-standalone-chromium:latest

Verify Selenium is running:

curl -sL http://localhost:4444/status` should return a `200` status code, and the response body should contain `{"value":{"ready":true}}` with 1 `availability: UP` node.

Access Selenium:

http://localhost:4444

Access noVNC:

http://localhost:7900/vnc.html`:
  • Login with the password secret.

Any WebDriver tests should point to Selenium on on port 4444.

The following is an example ChromeDriver test using Selenium to retrieve Chainguard's homepage:

from selenium import webdriver
from time import sleep

print("Testing ChromeDriver...")

options = webdriver.ChromeOptions()

driver = webdriver.Remote(
  command_executor='http://localhost:4444/',
  options=options
)

'''Maximize window'''
driver.maximize_window()
sleep(5)

'''Retrieve Chainguards homepage'''
driver.get("https://www.chainguard.dev/")
sleep(5)

'''Exit'''
driver.close()
driver.quit()
print("ChromeDriver test successful!")

Please note that Chromium is ran in a headless state with the sandbox with GPU access disabled with the flags:

--headless --no-sandbox --disable-gpu

Chromium is ran headless with GPU access disabled as the container does not have GPU access.

Chromium's sandbox has been disabled as the container is sandboxed from the host environment, and because the container is running as the root user.

This can be overriden via the environment variable CHROMIUM_USER_FLAGS though this is unsupported.

Running multiple components

All of the Docker Selenium components can be deployed together using using kubernetes with helm. More documentation on helm deployment is ava

Add Helm Repo

helm repo add docker-selenium https://www.selenium.dev/docker-selenium

To use them, simply replace the appropriate image: path with the Chainguard specific Jaeger image. Below is an example values file for doing this with helm: Microsoft Edge is disabled as it is not one of the offered Chainguard images

global:
  imageRegistry: cgr.dev/<ORGANIZATION>
isolateComponents:
  enabled: true
nodeChrome:
  imageName: docker-selenium-node-chromium
  imageTag: latest
edgeNode:
  enabled: false
router:
  imageName: docker-selenium-router
  imageTag: latest
distribution:
  imageName: docker-selenium-distributor
  imageTag: latest
sessionMap:
  imageName: docker-selenium-sessions
  imageTag: latest
sessionQueue:
  imageName: docker-selenium-session-queue
  imageTag: latest
eventBus:
  imageName: docker-selenium-event-bus
  imageTag: latest
jaeger:
  allInOne:
    enabled: true
    image:
      repository: cgr.dev/ORGANISATION/jaeger-all-in-one
      tag: latest

Install Helm Chart

helm upgrade --install selenium-grid charts/selenium-grid \
  --values values.yaml

Contact Support

If you have a Zendesk account (typically set up for you by your Customer Success Manager) you can reach out to Chainguard's Customer Success team through our Zendesk portal.

What are Chainguard Images?

Chainguard Images are a collection of container images designed for security and minimalism.

Many Chainguard Images are distroless; they contain only an open-source application and its runtime dependencies. These images do not even contain a shell or package manager. Chainguard Images are built with Wolfi, our Linux undistro designed to produce container images that meet the requirements of a secure software supply chain.

The main features of Chainguard Images include:

-dev Variants

As mentioned previously, Chainguard’s distroless Images have no shell or package manager by default. This is great for security, but sometimes you need these things, especially in builder images. For those cases, most (but not all) Chainguard Images come paired with a -dev variant which does include a shell and package manager.

Although the -dev image variants have similar security features as their distroless versions, such as complete SBOMs and signatures, they feature additional software that is typically not necessary in production environments. The general recommendation is to use the -dev variants only to build the application and then copy all application artifacts into a distroless image, which will result in a final container image that has a minimal attack surface and won’t allow package installations or logins.

That being said, it’s worth noting that -dev variants of Chainguard Images are completely fine to run in production environments. After all, the -dev variants are still more secure than many popular container images based on fully-featured operating systems such as Debian and Ubuntu since they carry less software, follow a more frequent patch cadence, and offer attestations for what they include.

Learn More

To better understand how to work with Chainguard Images, we encourage you to visit Chainguard Academy, our documentation and education platform.

Licenses

Chainguard Images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" version of this image:

  • Apache-2.0

  • BSD-3-Clause

  • CC-PDDC

  • FTL

  • GCC-exception-3.1

  • GPL-2.0-only

  • GPL-2.0-or-later

For a complete list of licenses, please refer to this Image's SBOM.

Software license agreement

Safe Source for Open Sourceâ„¢
Media KitContact Us
© 2024 Chainguard. All Rights Reserved.
Private PolicyTerms of Use

Product

Chainguard Images