PageSourceSearch

https://serenity-js.org/assets/js/3e81e718.6531ad8a.js

js serenity-js.org collected 2026-10-03 23:11:22 UTC 10,702 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkserenity_js_org=self.webpackChunkserenity_js_org||[]).push([[2933],{28453:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>a});var t=i(96540);const r={},s=t.createContext(r);function o(e){const n=t.useContext(s);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),t.createElement(s.Provider,{value:n},e.children)}},50605:(e,n,i)=>{i.r(n),i.d(n,{PlaywrightVersion:()=>c,assets:()=>l,contentTitle:()=>a,default:()=>g,frontMatter:()=>o,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"integration/docker","title":"Docker","description":"Serenity/JS Docker images enable you to run Serenity/JS tests in containerised environments,","source":"@site/src/docs/handbook/integration/docker.mdx","sourceDirName":"integration","slug":"/integration/docker","permalink":"/handbook/integration/docker","draft":false,"unlisted":false,"editUrl":"https://github.com/serenity-js/serenity-js.org/tree/main/src/docs/handbook/integration/docker.mdx","tags":[],"version":"current","lastUpdatedAt":1789512466000,"frontMatter":{"title":"Docker"},"sidebar":"docs","previous":{"title":"Integrations","permalink":"/handbook/integration/"},"next":{"title":"GitHub Actions","permalink":"/handbook/integration/github-actions"}}');var r=i(74848),s=i(28453);const o={title:"Docker"},a="Docker",l={},c=()=>{const{SupportedIntegrationVersion:e}=(0,s.R)()||{};return e||u("SupportedIntegrationVersion",!0),(0,r.jsx)(e,{name:"playwright-core",format:"exact"})},d=[{value:"Using Serenity/JS Docker Images",id:"using-serenityjs-docker-images",level:2},{value:"Available Images",id:"available-images",level:2},{value:"Serenity/JS Playwright image",id:"serenityjs-playwright-image",level:3},{value:"What's Included",id:"whats-included",level:4},{value:"Extending Serenity/JS Docker images",id:"extending-serenityjs-docker-images",level:2},{value:"Creating a Custom Image",id:"creating-a-custom-image",level:3},{value:"Adding Custom CA Certificates",id:"adding-custom-ca-certificates",level:3},{value:"Example: Embedding and Trusting Corporate CA Certificates",id:"example-embedding-and-trusting-corporate-ca-certificates",level:4},{value:"Things to Watch Out For",id:"things-to-watch-out-for",level:5},{value:"Building and publishing your custom image",id:"building-and-publishing-your-custom-image",level:3}];function h(e){const n={a:"a",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",header:"header",li:"li",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components},{DynamicCodeBlock:i}=n;return i||u("DynamicCodeBlock",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"docker",children:"Docker"})}),"\n",(0,r.jsxs)(n.p,{children:["Serenity/JS Docker images enable you to run Serenity/JS tests in containerised environments,\nincluding CI/CD pipelines, cloud development environments, and local development setups.\nThe images are maintained in the ",(0,r.jsx)(n.a,{href:"https://github.com/serenity-js/serenity-js-docker",children:"serenity-js/serenity-js-docker"})," repository\nand published through the ",(0,r.jsx)(n.a,{href:"https://github.com/orgs/serenity-js/packages",children:"Serenity/JS GitHub Container Registry"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"using-serenityjs-docker-images",children:"Using Serenity/JS Docker Images"}),"\n",(0,r.jsx)(n.p,{children:"Learn how to integrate Serenity/JS Docker images with your workflow:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/handbook/integration/github-actions/",children:"GitHub Actions"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/handbook/integration/github-codespaces/",children:"GitHub Codespaces"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/handbook/integration/gitlab-ci/",children:"GitLab CI"})}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"available-images",children:"Available Images"}),"\n",(0,r.jsx)(n.h3,{id:"serenityjs-playwright-image",children:"Serenity/JS Playwright image"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Recommended for"}),": ",(0,r.jsx)(n.a,{href:"/handbook/test-runners/playwright-test/",children:"Playwright Test"}),",\n",(0,r.jsx)(n.a,{href:"/handbook/test-runners/cucumber/",children:"Cucumber.js with Playwright"}),", and ",(0,r.jsx)(n.a,{href:"/handbook/test-runners/webdriverio/",children:"WebdriverIO"})," projects using modern browsers."]}),"\n",(0,r.jsxs)(n.p,{children:["The Serenity/JS Playwright Docker image provides a complete testing environment with all ",(0,r.jsx)(n.strong,{children:"Playwright browser engines"}),", plus the latest stable ",(0,r.jsx)(n.strong,{children:"Chrome"})," and ",(0,r.jsx)(n.strong,{children:"Edge"})," browsers.\nImage versions follow Playwright's versioning convention to ensure compatibility."]}),"\n",(0,r.jsxs)(i,{lang:"bash",title:"Install from the command line",children:["docker pull ghcr.io/serenity-js/playwright:v",(0,r.jsx)(c,{}),"-resolute"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["\ud83d\udce6 ",(0,r.jsx)(n.a,{href:"https://github.com/serenity-js/serenity-js-docker/pkgs/container/playwright",children:"View all versions"})]})}),"\n",(0,r.jsx)(n.h4,{id:"whats-included",children:"What's Included"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Browsers:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Microsoft Edge (Stable)"}),"\n",(0,r.jsx)(n.li,{children:"Google Chrome (Stable)"}),"\n",(0,r.jsx)(n.li,{children:"Playwright Chromium Engine"}),"\n",(0,r.jsx)(n.li,{children:"Playwright Chromium Headless Shell"}),"\n",(0,r.jsx)(n.li,{children:"Playwright Firefox Engine"}),"\n",(0,r.jsx)(n.li,{children:"Playwright WebKit Engine"}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Runtimes:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Node.js 24"}),"\n",(0,r.jsx)(n.li,{children:"OpenJDK Java Runtime Environment"}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Operating System:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Ubuntu 25.04 (Resolute)"}),"\n",(0,r.jsx)(n.li,{children:"Git"}),"\n",(0,r.jsx)(n.li,{children:"cURL"}),"\n",(0,r.jsx)(n.li,{children:"OpenSSH Client"}),"\n",(0,r.jsx)(n.li,{children:"Playwright system dependencies"}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"extending-serenityjs-docker-images",children:"Extending Serenity/JS Docker images"}),"\n",(0,r.jsx)(n.p,{children:"Serenity/JS base images are ready for immediate use,\nbut there are many situations where layering your own image provides more control.\nCommon needs include installing system tools, adding language runtimes, embedding corporate CA certificates,\nor adjusting environment-level settings for browsers, Node.js, or the JVM."}),"\n",(0,r.jsx)(n.h3,{id:"creating-a-custom-image",children:"Creating a Custom Image"}),"\n",(0,r.jsx)(n.p,{children:"Start by using an official Serenity/JS image as your base. This preserves the full testing toolchain\u2014browsers,\ndrivers, system dependencies, and Serenity/JS reporting\u2014while giving you space to tailor the environment."}),"\n",(0,r.jsxs)(i,{lang:"docker",title:"Dockerfile",children:["FROM ghcr.io/serenity-js/playwright:v",(0,r.jsx)(c,{}),"-resolute\n\n# Add your customisations here\n"]}),"\n",(0,r.jsx)(n.h3,{id:"adding-custom-ca-certificates",children:"Adding Custom CA Certificates"}),"\n",(0,r.jsx)(n.p,{children:"Teams using Serenity/JS often run tests against internal services protected by certificates signed by private Certificate Authorities (CAs).\nWithout installing those CAs, TLS requests from your test suite may fail.\nExtending the base image ensures both the OS and Node.js trust your internal CA."}),"\n",(0,r.jsx)(n.h4,{id:"example-embedding-and-trusting-corporate-ca-certificates",children:"Example: Embedding and Trusting Corporate CA Certificates"}),"\n",(0,r.jsxs)(i,{lang:"docker",title:"Dockerfile",children:["FROM ghcr.io/serenity-js/playwright:v",(0,r.jsx)(c,{}),"-resolute\n\n# Switch to root to install system-level dependencies\nUSER root\n\n# Copy your custom CA certs into the image.\n# This assumes you have certificates in a local folder named `certs/`\nCOPY certs/my-company-root-ca.crt /usr/local/share/ca-certificates/\n\n# Update and rehash the certificates\nRUN apt-get update \\\n  && update-ca-certificates \\\n  && rm -rf /var/lib/apt/lists/*\n\n# Tell Node.js about the certificates\nENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/my-company-root-ca.crt\n\n# (Optional) Drop back to a non-root user if the base image supports it\nUSER serenity-js\n"]}),"\n",(0,r.jsx)(n.h5,{id:"things-to-watch-out-for",children:"Things to Watch Out For"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Certificate Rotation"}),": If you rotate or add new CA certs, you\u2019ll need to rebuild and redeploy the image."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Credential Management"}),": Be careful not to bake in sensitive private keys or credentials unless the image is stored in a secure (private) registry."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"User Permissions"}),": Serenity/JS images run under a non-root serenity-js user by default. When installing packages or updating certificates, switch to root temporarily and revert afterwards to maintain secure defaults."]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"building-and-publishing-your-custom-image",children:"Building and publishing your custom image"}),"\n",(0,r.jsx)(n.p,{children:"To build and publish your Docker image, follow the instructions from your artifact registry vend
1or:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-registry",children:'Artifactory: "Docker registry"'})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry",children:'GitHub: "Working with the Container registry"'})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://docs.gitlab.com/ee/user/packages/container_registry/build_and_push_images.html",children:'GitLab: "Build and push container images to the Container Registry"'})}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}function u(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.