-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.32 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (39 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM rust:1-alpine AS builder
RUN apk add --no-cache \
musl-dev \
pkgconfig \
openssl-dev \
openssl-libs-static \
libssh2-dev \
libssh2-static \
zlib-dev \
zlib-static \
cmake \
make \
gcc \
g++ \
perl \
linux-headers
ENV OPENSSL_STATIC=1
WORKDIR /build
COPY Cargo.toml Cargo.lock ./
COPY crates/ crates/
RUN cargo build --release --package cargo-changeset
FROM alpine:3.21
RUN apk add --no-cache git su-exec curl gcc musl-dev
ENV RUSTUP_HOME="/usr/local/rustup" \
CARGO_HOME="/usr/local/cargo" \
PATH="/usr/local/cargo/bin:${PATH}"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --profile minimal --default-toolchain stable && \
chmod -R a+rX /usr/local/rustup /usr/local/cargo && \
cargo --version
RUN addgroup -g 1000 changeset && \
adduser -u 1000 -G changeset -h /home/changeset -s /bin/sh -D changeset
COPY --from=builder /build/target/release/cargo-changeset /usr/local/bin/cargo-changeset
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
LABEL org.opencontainers.image.source="https://github.com/lukidoescode/cargo-changeset"
LABEL org.opencontainers.image.description="Structured release management for Rust workspaces"
LABEL org.opencontainers.image.licenses="MIT"
ENTRYPOINT ["/entrypoint.sh"]