# Stage 1: The Builder # This stage takes a lightweight Alpine Linux image, installs the 'zip' utility, # and then copies your extension files into it to create the packages. FROM alpine:latest AS builder # Set the working directory inside the container. WORKDIR /extension # Copy all the extension files into the working directory. # Ensure your Dockerfile is in the same directory as these files. COPY manifest.json . COPY popup.html . COPY popup.js . COPY content.js . COPY background.js . COPY images/ ./images/ # Stage 2: The Final Package # This stage is a minimal image whose only purpose is to hold the final packages. # Using alpine instead of scratch and adding a CMD makes it easier to interact with. FROM alpine:latest # Set the output directory. WORKDIR /output # Create a subdirectory for the Chrome extension and copy all files into it. RUN mkdir chrome-extension COPY --from=builder /extension/ ./chrome-extension/ # Add a default command to list the contents of the output directory. # This makes the container runnable and prevents the "no command specified" error. CMD ["ls", "-l"]