-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Anchor failed to build with provided dockerfile #2589
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
Comments
The image is uploaded at backpackapp/build. We're also using Ubuntu latest in our CI with only these build dependencies.
From this StackOverflow question: sudo apt install zlib1g should install the necessary build dependencies.
The problem in solana-labs/solana#31960 is not yet fixed and it's not an Anchor specific issue. |
Oh my apologies, I pasted the wrong error it's libssl not libz that's giving the issue
this is why I had suspicions that it had to do with the newer ubuntu versions as 22.04 comes with libssl-dev3.0.9-1 while older versions of ubuntu had libssl-dev1.1.1. Of course I can manually downgrade the version of libssl-dev, but I would prefer not to resort to doing that. Thanks for pointing me to solana-labs/solana#31960 |
You can use You can use this Dockerfile to build with |
I've resolved the issue by making the following changes to the Dockerfile: # Previous lines
ARG SOLANA_CLI
ARG ANCHOR_CLI
# Updated lines
ARG SOLANA_CLI="v1.14.26"
ARG ANCHOR_CLI="v0.28.0"
# Added these lines to download and install libssl1.1
RUN wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
RUN dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
# After install anchor command
# Also, added the following line to fix the error related to rustc version
RUN solana-install init 1.16.3 |
This problem wasn't caused by Anchor to begin with but it should be fixed in |
Trying to build the docker file here results in
error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
.solana-cli: v1.14.22
anchor: v0.28.0
This arised from trying to fix anchor build on ubuntu 22.04 with the same error. Upgrading solana-cli to 1.16.5 fixed it, but then all subsequent programs compiled and running on the local test validator end up with this kind of issue
The text was updated successfully, but these errors were encountered: