DirectorySecurity advisories
Sign in

Directory

docker-selenium logo

docker-selenium

Last changed
Get started with latest for free
docker pull cgr.dev/chainguard/docker-selenium

Need access to a specific version? Contact us.

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

Minimal docker-selenium container image with Chromium.

Download this Image

The image is available on cgr.dev:

docker pull cgr.dev/chainguard/docker-selenium:latest

Usage

Run the container with the following command:

docker run --shm-size="2g" -p 4444:4444 -p 7900:7900 cgr.dev/chainguard/docker-selenium: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/wd/hub',
  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.

Licenses

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

  • ( GPL-2.0-or-later

  • AFL-2.1

  • Apache-2.0

  • BSD-1-Clause

  • BSD-2-Clause

  • BSD-3-Clause

  • BSD-4-Clause

View more

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

Software license agreement

Products

Chainguard Images

© 2024 Chainguard, Inc.