All checks were successful
Upload the container / build-and-upload (push) Successful in 11m22s
55 lines
2 KiB
Docker
55 lines
2 KiB
Docker
FROM git.dzuchun.ing/actions/alpine AS builder
|
|
|
|
ENV PATH="/root/.cargo/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
|
|
|
# update package registry, install
|
|
# - deps necessary(?) to build-std on musl
|
|
# - upx
|
|
# - jq (for package metadata processing)
|
|
RUN apk update; \
|
|
apk add --no-cache musl-dev; \
|
|
apk add --no-cache gcc; \
|
|
apk add --no-cache libunwind-static; \
|
|
apk add --no-cache xz-static; \
|
|
apk add --no-cache curl-static; \
|
|
apk add --no-cache openssl-libs-static; \
|
|
apk add --no-cache perl; \
|
|
apk add --no-cache make; \
|
|
apk add --no-cache upx; \
|
|
apk add --no-cache jq; \
|
|
apk cache clean;
|
|
|
|
# install Rust
|
|
RUN apk add --no-cache curl; \
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh; \
|
|
chmod +x rustup.sh; \
|
|
./rustup.sh -c cargo --profile minimal -y; \
|
|
rustup -v toolchain install stable --profile minimal; \
|
|
rustup -v +stable component remove rust-docs || true; \
|
|
rustup -v +stable component remove clippy || true; \
|
|
rustup -v +stable component remove rustfmt || true; \
|
|
rustup -v +stable component remove llvm-tools || true; \
|
|
rustup -v toolchain install nightly --profile minimal; \
|
|
rustup -v +nightly component remove rust-docs || true; \
|
|
rustup -v +nightly component remove clippy || true; \
|
|
rustup -v +nightly component remove rustfmt || true; \
|
|
rustup -v +nightly component remove llvm-tools || true; \
|
|
rustup -v +nightly component add rust-src || true; # build-std needs this component \
|
|
rustup +stable component list; \
|
|
rustup +nightly component list; \
|
|
apk del curl;
|
|
|
|
# install cargo-licese
|
|
RUN cargo install cargo-license
|
|
|
|
# separate step to remove layers
|
|
FROM git.dzuchun.ing/actions/alpine
|
|
|
|
COPY --from=builder . .
|
|
COPY build.sh /
|
|
|
|
# setup environment
|
|
ENV PATH="/root/.cargo/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
|
|
|
# labels
|
|
LABEL org.opencontainers.image.source=https://git.dzuchun.ing/actions/anode-builder
|