-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 776 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 776 Bytes
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
FROM rust:1.61-alpine3.16 as builder
RUN apk update
RUN apk add libc-dev openssl-dev openssl github-cli
RUN USER=root cargo new --bin crom
WORKDIR /crom
COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock
RUN cargo build --release --features gh-cli
RUN rm src/*.rs
ADD . ./
ARG VERSION=0.0.1-dev
RUN rm ./target/release/deps/crom*
RUN cargo run --release --features gh-cli -- write-version custom ${VERSION}
RUN cargo run --release --features gh-cli -- gh --help
RUN cargo build --release --features gh-cli
FROM alpine:3.16 as release
RUN apk add --no-cache ca-certificates openssl tzdata github-cli
COPY --from=builder /crom/target/release/crom /usr/bin/crom
WORKDIR /target
ENTRYPOINT ["/usr/bin/crom"]
# Run basic test
RUN crom --help && crom gh --help