Skip to content

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

Merged
mre merged 1 commit intolycheeverse: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 intolycheeverse:masterfrom
eread:eread/fix-possible-outputs-of-arch-command-in-alpine-dockerfile

Conversation

@eread
Copy link
Contributor

@eread eread commented Jul 28, 2025

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
Copy link
Contributor Author

eread commented Jul 28, 2025

@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").

Copy link
Member

@mre mre left a comment

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
Copy link
Member

mre commented Jul 28, 2025

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
Copy link
Contributor Author

eread commented Jul 28, 2025

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
Copy link
Member

mre commented Aug 7, 2025

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
Copy link
Contributor Author

eread commented Aug 18, 2025

@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