playwright: [Bug]: 'latest' tag is pointing to "v1.46.1-jammy" docker image

Version

1.47.0

Steps to reproduce

docker pull mcr.microsoft.com/playwright:latest

Expected behavior

Pulling “v1.47.0-noble” (sha256:3d41153494e2b12a5a5fa6e26cf1e854c3997d13758754d46e7bf902b5ba09b1)

Actual behavior

Pulling “v1.46.1-jammy” (sha256:02810c978d5396bf382ab6015c25ad6bed9e39f4a41c5b9c829e9fea439274e2)

Additional context

v1.47.0 Release notes => “The mcr.microsoft.com/playwright:v1.47.0 now serves a Playwright image based on Ubuntu 24.04 Noble. To use the 22.04 jammy-based image, please use mcr.microsoft.com/playwright:v1.47.0-jammy instead.”

Environment

System:
    OS: Linux 6.5 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (2) x64 AMD EPYC 7763 64-Core Processor
    Memory: 6.35 GB / 7.74 GB
    Container: Yes
  Binaries:
    Node: 20.17.0 - /usr/local/share/nvm/versions/node/v20.17.0/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 10.5.1 - /workspaces/components/node_modules/.bin/npm
  IDEs:
    VSCode: 1.92.2 - /vscode/bin/linux-x64/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/bin/remote-cli/code
  Languages:
    Bash: 5.0.17 - /usr/bin/bash

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (11 by maintainers)

Most upvoted comments

@marekdedic sorry to hear! I was looking into 3 and found an approach which seems to work quite nicely and which applies the best practises. Would that work for you?


name: Playwright Tests
on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]
jobs:
  read-playwright-version:
    name: 'Read Playwright Version'
    runs-on: ubuntu-latest
    outputs:
      playwright-version: ${{ steps.get_playwright_version.outputs.playwright-version }}
    steps:
      - uses: actions/checkout@v4
      - run: |
          playwright_version=$(node -e 'console.log(require("./package-lock.json")["packages"]["node_modules/@playwright/test"].version)')
          echo "playwright-version=$playwright_version" >> $GITHUB_OUTPUT
        id: get_playwright_version
  playwright:
    name: 'Run Playwright Tests'
    runs-on: ubuntu-latest
    needs: read-playwright-version
    container:
      image: mcr.microsoft.com/playwright:v${{ needs.read-playwright-version.outputs.playwright-version }}-noble
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 18
      - name: Install dependencies
        run: npm ci
      - name: Run your tests
        run: npx playwright test
        env:
          HOME: /root

(The reason why I read package-lock.json is to avoid doing “npm ci” which usually takes a few seconds. If you use a different package manager, this step might be different).

Whilst I’m an advocate that people should use a specific tag - especially in pipelines etc., it does seem very odd for the :latest tag to point to an old version. It goes against common Docker practice and will likely catch people out.

E.g. I’m sure it will be common for someone when first trying out Playwright, to just do something like docker pull mcr.microsoft.com/playwright without specifying any tag at all (and therefore using :latest by default). They wouldn’t expect to get an old version.

I think this ought to be reconsidered. If you really don’t want to support the :latest tag, then it should probably be removed entirely—but that will undoubtedly cause some chaos and will leave a slightly uncommon registry where no :latest tag exists…

@mxschmitt I can confirm that your suggestion works nicely, thank you!

If anyone stumbles upon this in the future, see e.g. marekdedic/dedic.eu#351

OK, fair enough.

In that case, I’d suggest making the documentation a little clearer. Right now it states:

It is recommended to always pin your Docker image to a specific version if possible.

It should perhaps say that :latest is now deprecated and will give an old version of Playwright?

Sorry to keep pushing on this one, but I genuinely feel it’s going to catch some people out, and hence updating the docs to make it as clear as possible would seem sensible.