Closed abdelilahakebli closed 3 months ago
take a look go.mod
, you need run go get -u github.com/playwright-community/playwright-go
upgrade, not only install new driver and deps
is there any working Dockerfile example with alpine or ubuntu?
same problem
Look at the example below. Please make sure the playwright-go
version in go.mod
is the same as v0.4201.0
in the Dockerfile
.
# Step 1: Modules caching
FROM golang:1.21 as modules
COPY go.mod go.sum /modules/
WORKDIR /modules
RUN go mod download
# Step 2: Build
FROM golang:1.21 as builder
COPY --from=modules /go/pkg /go/pkg
COPY . /app
WORKDIR /app
RUN go install github.com/playwright-community/playwright-go/cmd/playwright@v0.4201.0
RUN GOOS=linux GOARCH=amd64 \
go build -o /bin/app
# Step 3: Final
FROM ubuntu:jammy
COPY --from=builder /go/bin/playwright /playwright
COPY --from=builder /bin/app /app
RUN apt-get update && apt-get install -y ca-certificates tzdata \
&& /playwright install --with-deps chromium \
&& rm -rf /var/lib/apt/lists/*
CMD ["/app"]
Take a look at https://github.com/playwright-community/playwright-go#docker
Could not launch playwright when updating to v0.4101.0 using docker
Rolling back to v0.4001.0 fixed the issue for me