Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: migrate Docker instructions to relative bind mount #420

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MikeMcC399
Copy link

@MikeMcC399 MikeMcC399 commented Mar 4, 2025

Issue

The README > Run using Docker command example

docker run -v ${PWD}:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable /tmp/README.md

uses PWD (Print Working Directory). The syntax ${PWD} can now be replaced by a simpler one using relative paths.

Relative paths

The Docker documentation for docker container run (with alias docker run) describes the option Mount volume (-v) using relative paths:

As of Docker Engine version 23, you can use relative paths on the host.

docker run -v ./content:/content -w /content -i -t ubuntu pwd

Change

Use the relative path . syntax instead of ${PWD}:

docker run -v .:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable /tmp/README.md

Verification

For example, under Ubuntu 24.04.2 LTS

git clone https://github.com/tcort/markdown-link-check
cd markdown-link-check
docker run -v .:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable /tmp/README.md

Confirm that markdown-link-check runs successfully.

Logs

$ docker run -v .:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable /tmp/README.md
Unable to find image 'ghcr.io/tcort/markdown-link-check:stable' locally
stable: Pulling from tcort/markdown-link-check
43c4264eed91: Pull complete
453ca8c35a67: Pull complete
7a291b8a7b57: Pull complete
15929fe50b42: Pull complete
c70efbd48e66: Pull complete
4f4fb700ef54: Pull complete
0e06fe306355: Pull complete
b28c781acdb5: Pull complete
5e49cffc8ea6: Pull complete
68f40888b8a2: Pull complete
Digest: sha256:b812aa72676ed310c045d2c89d56abc1f88dd06e68edbea982799a7ff01c8569
Status: Downloaded newer image for ghcr.io/tcort/markdown-link-check:stable

FILE: /tmp/README.md
  [✓] https://www.npmjs.com/package/isemail
  [✓] https://github.com/gaurav-nelson/github-action-markdown-link-check
  [✓] https://pre-commit.com
  [✓] https://megalinter.io/latest/
  [✓] https://megalinter.io/latest/descriptors/markdown_markdown_link_check/
  [✓] https://www.npmjs.com/package/ms
  [✓] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_the_replacement
  [✓] https://github.com/tcort/markdown-link-check/blob/master/LICENSE.md
  [✓] https://github.com/tcort/markdown-link-check/actions/workflows/ci.yml/badge.svg

  9 links checked.

@MikeMcC399 MikeMcC399 marked this pull request as ready for review March 4, 2025 10:14
@BaseMax
Copy link
Collaborator

BaseMax commented Mar 4, 2025

Dear Mike,

Thank you for your contribution. I see that your merge request is still in draft. Once it is ready for review, please let us know.

Many thanks.

@MikeMcC399

This comment was marked as resolved.

@BaseMax BaseMax requested review from smainil and WillGibson March 4, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants