I have a spring app that runs with the following dockerfile (used for Tilt locally):
FROM amazoncorretto:21-alpine-jdk AS builder
# Install "entr" package using apk package manager
RUN apk update && \
apk add entr
FROM public.ecr.aws/amazoncorretto/amazoncorretto:21
COPY --from=builder /lib/ld-musl-aarch64.so.1 /lib/ld-musl-aarch64.so.1
COPY --from=builder /usr/bin/entr /usr/bin/entr
ENV MAIN_OPTS ''
RUN yum install -y tar && mkdir -p /opt/demo/
ADD BOOT-INF/lib /opt/demo/lib
ADD META-INF /opt/demo/META-INF
ADD BOOT-INF/classes /opt/demo
WORKDIR /opt/demo/
ENTRYPOINT java $JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5013 -cp .:./lib/* io.demo.DemoApplication $MAIN_OPTS
EXPOSE 8080
I would like to head Playwright's headless browser (version 1.40.0) so I can PDF export my site. Added ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD 1 to my dockerfile so it doesn't download the browser (headless). I need to add to my dockerfile the playwright image so it knows to install everything it needs on the docker image. tried the following things (separately), without success:
FROM mcr.microsoft.com/playwright/java:v1.40.0-jammy as playwright
FROM apify/actor-node-playwright:16
FROM mcr.microsoft.com/playwright/python:v1.40.0-focal
Got various errors, including:
entr: exec java: No such file or directory
failed to install browsers
failed to create driver
Without anything from above (except the skip browser download flag) I get this error:
Failed to read message from driver, pipe closed
My question is, how do I make a multi-stage docker file on top of my current build, so the image will have playwright on it?
Notice I'm not using Playwright for tests in this case, if it matters.