Closed kimburgess closed 2 years ago
Hm, the new images should be based on alpine 3.12 and not include that commit.
ref https://github.com/crystal-lang/crystal/issues/10366#issuecomment-799472500
libyaml it's not missing. In that docker image you can see that
# pkg-config yaml-0.1 --libs
-lyaml
But the static libyaml is not there which seems to be what you want.
# apk add --update yaml-static
After that your program will link with --static.
The 3.13 image does have yaml-static
, but that was a new addition.
In the current image, it seems the repository is still 3.12. Is this the cause?
$ docker run --rm -it crystallang/crystal:0.36.1-alpine cat /etc/apk/repositories
http://dl-cdn.alpinelinux.org/alpine/v3.12/main
http://dl-cdn.alpinelinux.org/alpine/v3.12/community
$ docker images | grep 0.36.1-alpine
crystallang/crystal 0.36.1-alpine 32474966bd9f 3 days ago 314MB
@maiha the images were reverted to 3.12 for the CI as explained in https://github.com/crystal-lang/crystal/issues/10366#issuecomment-799472500 . The issue on that image the lack of yaml-static which I think is optional and as any library can be tweaked by the user.
Easy enough to workaround downstream for now. Given it was available previously and is needed running a static build using only std lib components, is it worth reintroducing it to the 3.12 based image?
Closing. The latest docker images all contain yaml-static
.
A new Alpine image for 0.36.1 made it's way to docker hub last night. This is unable to statically compile crystal programs that use YAML.
Reduced example: https://gist.github.com/kimburgess/2a740af0f2c8bc5b217a9fa47638df0e.
~Cause appears to be https://github.com/crystal-lang/distribution-scripts/commit/bdff883a42e007acac17549b4d44ba8a3dc83264~
Build output: