Docker container for link checking
Posted by mholmes on 01 Oct 2020 in Announcements
I was able to get the W3C checklink tool working as a Docker container after modifying the Dockerfile found at https://github.com/stupchiy/docker-w3c-checklink/blob/master/Dockerfile to add some missing dependencies; this is my working file:
FROM ubuntu
MAINTAINER Sergiy Tupchiy <stupchiy@gmail.com>
# Install dependencies required for link-checker distribution installation
RUN apt-get update && apt-get install -y \
cpanminus \
make \
build-essential \
libssl-dev \
curl \
libnet-ssleay-perl \
&& rm -rf /var/lib/apt/lists/*
ENV CHECKLINK_VERSION 4_81
ARG CHECKLINK_URL=https://github.com/w3c/link-checker/archive/checklink-${CHECKLINK_VERSION}.tar.gz
RUN set -x \
&& curl -sSL ${CHECKLINK_URL} -o /tmp/link-checker.tar.gz \
&& mkdir -p /usr/src \
&& tar -xzf /tmp/link-checker.tar.gz -C /usr/src \
&& rm /tmp/link-checker.tar.gz \
&& cd /usr/src/link-checker-checklink-${CHECKLINK_VERSION} \
&& cpanm --installdeps . \
&& cpanm IO::Socket::SSL \
&& cpanm LWP::Protocol::https \
&& perl Makefile.PL \
&& make \
&& make test \
&& make install \
&& rm -rf /usr/src/link-checker-checklink-${CHECKLINK_VERSION}
ENTRYPOINT ["/usr/local/bin/checklink"]
CMD ["-h"]
I'm now able to run it using:
docker run -it --rm link-checker checklink -H --recursive https://mapoflondon.uvic.ca > report.html
The plan is to build a complete local copy of e.g. MoEML and then start a Python simple server there, and point the link checker at it.