-
Notifications
You must be signed in to change notification settings - Fork 129
Make the Docker rust base image configurable. #2568
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
base: main
Are you sure you want to change the base?
Changes from all commits
7293e1c
a0d1d97
bec1f85
7f37b6f
fbb1636
88eb49b
b2a3a11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,31 @@ | ||
| FROM rust:latest | ||
| ARG RUST_IMAGE=latest | ||
|
|
||
| FROM rust:${RUST_IMAGE} AS builder | ||
|
|
||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| build-essential cmake pkg-config git \ | ||
| libssl-dev libudev-dev libdbus-1-dev && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| ARG CLI_REPO=https://github.com/stellar/stellar-cli | ||
| ARG CLI_REF=main | ||
|
|
||
| WORKDIR /src | ||
| RUN git clone "${CLI_REPO}" . && \ | ||
| git checkout "${CLI_REF}" | ||
|
Comment on lines
+15
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure we want to checkout via git from the dockerfile. This is somewhat misleading for users who build with the dockerfile locally. e.g. as it sits IMO - we would be better off doing the following:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the dockerfile will be extracted into its own repo, as per this thread. But I believe the proper fix is actually just downloading the binary distributed through the release pages, because re-building the cli inside/outside the dockerfile is changing the cliver metadata anyway. I'm just confirming if we want to move into that direction before doing the work. |
||
|
|
||
| RUN cargo build --package stellar-cli --release | ||
|
|
||
| FROM rust:${RUST_IMAGE} | ||
|
|
||
| RUN rustup target add wasm32v1-none | ||
|
|
||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends libudev1 libssl3 && \ | ||
| apt-get install -y --no-install-recommends libudev1 libssl3 libdbus-1-3 && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| ARG TARGETARCH | ||
| COPY stellar-${TARGETARCH}/stellar /usr/local/bin/stellar | ||
| COPY --from=builder /src/target/release/stellar /usr/local/bin/stellar | ||
| RUN chmod +x /usr/local/bin/stellar | ||
|
|
||
| ENV STELLAR_CONFIG_HOME=/config | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[picky] we might want to resolve the input ref into a commit sha before the build job. Technically this could race condition if a branch is passed and the branch is updated between amd64 run and arm64 run?
Though this isn't an issue when running on publish so am fine ignoring.