Skip to content

Instantly share code, notes, and snippets.

@jpollack
Last active August 9, 2021 21:55
Show Gist options
  • Save jpollack/e256d7c20249c4b164b263a1e78fbeb9 to your computer and use it in GitHub Desktop.
Save jpollack/e256d7c20249c4b164b263a1e78fbeb9 to your computer and use it in GitHub Desktop.
Dockerfile for WWW::Mechanize::Chrome
# To build:
# $ docker build -t perl-wmc <Dockerfile-wmc
#
# To run:
# $ docker run -v $(pwd):/wd --network=host -it --rm perl-wmc <perl script>
#
FROM debian:stable-slim AS base
RUN \
apt-get update \
&& apt-get install -y \
libimager-perl \
perl \
&& rm -rf /var/lib/apt/lists/*
FROM base AS build
RUN \
apt-get update \
&& apt-get install -y \
build-essential \
chromium \
cpanminus \
libpng-dev \
&& rm -rf /var/lib/apt/lists/*
RUN cpanm -n -v --self-contained WWW::Mechanize::Chrome
FROM base AS run
COPY --from=build /usr/local /usr/local
WORKDIR /wd
ENTRYPOINT ["/usr/bin/perl"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment