Skip to content

Fix possible outputs of 'arch' command in Alpine Linux-based Dockerfile#1778

Merged
mre merged 1 commit into
lycheeverse:masterfrom
eread:eread/fix-possible-outputs-of-arch-command-in-alpine-dockerfile
Jul 28, 2025
Merged

Fix possible outputs of 'arch' command in Alpine Linux-based Dockerfile#1778
mre merged 1 commit into
lycheeverse:masterfrom
eread:eread/fix-possible-outputs-of-arch-command-in-alpine-dockerfile

Conversation

@eread

@eread eread commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

A follow up to: #1774.

That pull request seemed to correctly provide a new lychee-aarch64-unknown-linux-musl.tar.gz build (see nightly: https://github.com/lycheeverse/lychee/releases/tag/nightly), but incorrectly changed what the expected output from Alpine Linux's arch command was.

This pull request restores the original parsing of the output, but retains the new format of what is set in $ARCH for use later. It might be possible to further refine the Dockerfile, but the intention here is to make as few changes as possible each time.

@eread

eread commented Jul 28, 2025

Copy link
Copy Markdown
Contributor Author

@mre @willnode Could you review?

The way to know this is it the correct fix is (assuming Docker is set up locally):

  1. Run docker run --rm -ti --platform "linux/arm64" alpine:latest sh.
  2. In the running container, run arch. You'll see aarch64 is returned.
  3. Exit that running container.
  4. Run docker run --rm -ti --platform "linux/amd64" alpine:latest sh.
  5. In the running container, run arch. You'll see x86_64 is returned.

With this change, I can also locally build a Docker image with the Alpine Linux Docker file for the linux/amd64 platform by running (assuming buildx is available):

docker buildx build --platform "linux/amd64" --file Dockerfile-CI.alpine.Dockerfile .

Building for linux/arm64 platform locally doesn't work yet, but I think that's unrelated to the changes here and in #1774. This is the command for that (assuming buildx is available):

docker buildx build --platform "linux/arm64" --file Dockerfile-CI.alpine.Dockerfile .

If we run wget with -v (verbose) instead of -q (quiet) within the Dockerfile, it seems like we're trying to pull both of these:

  • https://github.com/lycheeverse/lychee/releases/latest/download/lychee-aarch64-unknown-linux-musl.tar.gz (which is found)
  • https://github.com/lycheeverse/lychee/releases/download/lychee-v0.19.1/lychee-aarch64-unknown-linux-musl.tar.gz (which is not found, and you can imagine that's expected)

It is likely that when the next release happens, this problem will go away. I haven't really looked into if this should be the expected behavior (wanting both "latest" and "latest released").

@mre mre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@mre mre merged commit c705e90 into lycheeverse:master Jul 28, 2025
6 checks passed
@mre

mre commented Jul 28, 2025

Copy link
Copy Markdown
Member

I didn't test it locally, but given that the setup is broken in master right now and that this PR reverts to the previous behavior, I'd say it's fine to merge.

@eread

eread commented Jul 28, 2025

Copy link
Copy Markdown
Contributor Author

I didn't test it locally, but given that the setup is broken in master right now and that this PR reverts to the previous behavior, I'd say it's fine to merge.

Thanks @mre. Do you think a new release is far away?

@eread eread deleted the eread/fix-possible-outputs-of-arch-command-in-alpine-dockerfile branch July 28, 2025 23:44
@mre

mre commented Aug 7, 2025

Copy link
Copy Markdown
Member

I hope to get a release out after the next batch of fixes/features which are still open. Would like to at least update the dependencies before. #1779
Help wanted.

@eread

eread commented Aug 18, 2025

Copy link
Copy Markdown
Contributor Author

@mre @thomas-zahner I managed to figure out the problem I was having locally (#1778 (comment)).

When wget tries to access https://github.com/lycheeverse/lychee/releases/latest/download/, it's redirected not to the nightly (which now has the additional build) but rather to 0.19.1, which doesn't have the additional build yet.

If I update the Docker file to access the nightly when LYCHEE_VERSION is set to either nightly or latest (which is the default if LYCHEE_VERSION is unset), it works!

I've raised a pull request (#1802) in case you want that behavior for the project.

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.

2 participants