filiph/linkcheck

Unable to evaluate localhost via Docker container

larrybotha opened this issue · 1 comments

Problem

When building and running a Docker container for linkcheck, evaluating localhost:[port] on the host always results in connection failed

  • Expected: site to be crawled
  • Actual: linkchecker reports connection failed

Steps to reproduce

  1. create a Dockerfile using the following:
    FROM tennox/linkcheck
  2. build an image from the Dockerfile $ docker build --platform linux/arm64 -t filiph/linkcheck .
  3. run a server at some port from the host
  4. evaluate the server via the docker container using $ docker run --rm -it filiph/linkcheck :[port]

Additional info

Running linkchecker after installing via homebrew / dart works as expected.

With Docker, I've also attempted the following URLs:

System settings

  • Mac OS 12.5 (M1)
  • Docker: Docker for desktop v4.11.0 / Docker v20.10.17
  • linkcheck version:

EDIT: updated Docker image to be built from latest available tag at Docker hub /tennox/linkcheck

✋🏻 I am facing the exact same issue.

What is strange is I think it was running fine a few days ago and not today 🤔

linkcheck version 2.0.20

My usage

On a Linux host

docker-compose up <my-service>
-> binds in 8000:8000
docker run --rm \
	--network=host \
	-v "${PWD}/tools/linkcheck/:/skipfiles/" \
	tennox/linkcheck :8000 --skip-file /skipfiles/skip_files.txt

Crawling...

Provided URLs failing:
http://localhost:8000/ (connection failed)


Stats:
       0 links
       1 destination URLs
       0 URLs ignored
       0 warnings
       1 errors

make: *** [Makefile:115: test-live-links] Error 2

Despite the fact that, within the linkcheck container

# curl -I  http://localhost:8000

HTTP/1.0 200 OK
Date: Thu, 09 Feb 2023 19:05:16 GMT
Server: WSGIServer/0.2 CPython/3.9.2
Content-Type: text/html
Content-Length: 80749