Skip to content

Unable to build Alpine Docker image #2016

@jenstroeger

Description

@jenstroeger

Hi, with the following Dockerfile

FROM alpine:3.21

RUN apk update && apk add curl postgresql17-dev

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly -y
ENV PATH="/root/.cargo/bin:${PATH}"

RUN cargo install cargo-pgrx  

I’m unable to build cargo-pgrx

...
#8 [4/4] RUN cargo install cargo-pgrx
#8 0.222     Updating crates.io index
#8 1.083  Downloading crates ...
#8 1.371   Downloaded cargo-pgrx v0.13.1
#8 1.413   Installing cargo-pgrx v0.13.1
#8 1.467     Updating crates.io index
#8 6.020      Locking 312 packages to latest compatible versions
#8 6.022       Adding backtrace v0.3.71 (available: v0.3.74)
#8 6.023       Adding cargo_metadata v0.18.1 (available: v0.19.2)
#8 6.023       Adding cargo_toml v0.21.0 (available: v0.22.1)
#8 6.025       Adding clap-cargo v0.14.1 (available: v0.15.2)
#8 6.062  Downloading crates ...
...
#8 191.4 error[E0425]: cannot find function `get_latest_dependency` in crate `cargo_edit`
#8 191.4    --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-pgrx-0.13.1/src/command/upgrade.rs:132:46
#8 191.4     |
#8 191.4 132 |                 let dependency = cargo_edit::get_latest_dependency(
#8 191.4     |                                              ^^^^^^^^^^^^^^^^^^^^^ not found in `cargo_edit`
#8 191.4 
#8 193.3 For more information about this error, try `rustc --explain E0425`.
#8 193.3 error: could not compile `cargo-pgrx` (bin "cargo-pgrx") due to 1 previous error
#8 193.4 error: failed to compile `cargo-pgrx v0.13.1`, intermediate artifacts can be found at `/tmp/cargo-installtnyC2y`.
#8 193.4 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
#8 ERROR: process "/bin/sh -c cargo install cargo-pgrx" did not complete successfully: exit code: 101

Am I missing a dependent package, or what’s happening here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions