Skip to content

[Question] What to add to a Jenkins Docker file to execute a Playwright test using Maven #759

@ramsesdm

Description

@ramsesdm

I am trying to execute a Playwright test (Java) in a dockerized Jenkins job.

This is my Dockerfile (from the Jenkins site)

FROM jenkins/jenkins:2.319.1-jdk11
USER root
RUN apt-get update && apt-get install -y lsb-release

RUN curl -fsSLo /usr/share/keyrings/docker-archive-keyring.asc \
  https://download.docker.com/linux/debian/gpg
RUN echo "deb [arch=$(dpkg --print-architecture) \
  signed-by=/usr/share/keyrings/docker-archive-keyring.asc] \
  https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
RUN apt-get update && apt-get install -y docker-ce-cli
USER jenkins

RUN jenkins-plugin-cli --plugins "blueocean:1.25.2 docker-workflow:1.26"

When I executed the job I got this

Host system is missing a few dependencies to run browsers.                                        
Please install them with the following command:                                                                                                                                                          sudo mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="install-deps"
<3 Playwright Team

Inside the Docker image, I tried to execute the command but at some point, I got this:

Note, selecting 'libfontconfig1' instead of 'libfontconfig'
Package ttf-ubuntu-font-family is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package libjpeg-turbo8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ttf-ubuntu-font-family' has no installation candidate
E: Unable to locate package libenchant1c2a
E: Unable to locate package libicu66
E: Package 'libjpeg-turbo8' has no installation candidate

To run the test I am using Maven

Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions