1 Star 1 Fork 0

Credhat/foundry-mirror

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
# syntax=docker/dockerfile:1.4
FROM alpine:3.18 as build-environment
ARG TARGETARCH
WORKDIR /opt
RUN apk add clang lld curl build-base linux-headers git \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh \
&& chmod +x ./rustup.sh \
&& ./rustup.sh -y
RUN [[ "$TARGETARCH" = "arm64" ]] && echo "export CFLAGS=-mno-outline-atomics" >> $HOME/.profile || true
WORKDIR /opt/foundry
COPY . .
RUN --mount=type=cache,target=/root/.cargo/registry --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/opt/foundry/target \
source $HOME/.profile && cargo build --release \
&& mkdir out \
&& mv target/release/forge out/forge \
&& mv target/release/cast out/cast \
&& mv target/release/anvil out/anvil \
&& mv target/release/chisel out/chisel \
&& strip out/forge \
&& strip out/cast \
&& strip out/chisel \
&& strip out/anvil;
FROM docker.io/frolvlad/alpine-glibc:alpine-3.16_glibc-2.34 as foundry-client
RUN apk add --no-cache linux-headers git
COPY --from=build-environment /opt/foundry/out/forge /usr/local/bin/forge
COPY --from=build-environment /opt/foundry/out/cast /usr/local/bin/cast
COPY --from=build-environment /opt/foundry/out/anvil /usr/local/bin/anvil
COPY --from=build-environment /opt/foundry/out/chisel /usr/local/bin/chisel
RUN adduser -Du 1000 foundry
ENTRYPOINT ["/bin/sh", "-c"]
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Foundry" \
org.label-schema.description="Foundry" \
org.label-schema.url="https://getfoundry.sh" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/foundry-rs/foundry.git" \
org.label-schema.vendor="Foundry-rs" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Rust
1
https://gitee.com/Credhat/foundry-mirror.git
git@gitee.com:Credhat/foundry-mirror.git
Credhat
foundry-mirror
foundry-mirror
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385