-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor improvements to repro builds with Docker
- Loading branch information
Showing
3 changed files
with
35 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,29 @@ | ||
FROM rust:1.81.0-bookworm@sha256:7b7f7ae5e49819e708369d49925360bde2af4f1962842e75a14af17342f08262 | ||
|
||
ARG USER_ID | ||
ARG GROUP_ID | ||
|
||
RUN groupadd -g ${GROUP_ID} user && \ | ||
useradd -m -u ${USER_ID} -g user user | ||
|
||
USER user | ||
|
||
WORKDIR /usr/src/builtin-actors | ||
|
||
# Install the compiler. Unfortunately, the rust docker container doesn't actually contain the rust | ||
# compiler... | ||
COPY ./rust-toolchain.toml . | ||
RUN rustup show | ||
RUN rustup toolchain install $(cat rust-toolchain.toml | grep channel | cut -d '"' -f 2) && \ | ||
rustup component add rustfmt clippy && \ | ||
rustup show | ||
|
||
USER root | ||
|
||
# Then checkout a clean copy of the repo. | ||
RUN --mount=type=bind,rw,target=/tmp/repo \ | ||
echo "Building $(git -C /tmp/repo rev-parse HEAD)" && \ | ||
git --git-dir /tmp/repo/.git --work-tree . checkout -f HEAD | ||
|
||
ENTRYPOINT ["/bin/bash", "-c"] | ||
USER user | ||
|
||
ENTRYPOINT ["/bin/bash", "-c"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters