-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 860 Bytes
/
Dockerfile
File metadata and controls
36 lines (25 loc) · 860 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
32
33
34
35
36
FROM alpine:latest AS builder
# Install the necessary packages and Rust.
RUN apk add --update pkgconfig curl clang openssl-libs-static openssl-dev
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --profile minimal
# Add `cargo` to the path.
ENV PATH=/root/.cargo/bin:$PATH
WORKDIR /tmp/sprocket
# Copy the necessary source
COPY ./Cargo.toml ./Cargo.lock ./
COPY ./src ./src
COPY ./benches ./benches
COPY ./crates ./crates
COPY ./tests ./tests
COPY ./migrations ./migrations
# Build the release version of Sprocket
RUN cargo build --release
RUN strip target/release/sprocket
# Set up the final Sprocket image
FROM alpine:latest
RUN apk add --update shellcheck
COPY --from=builder /tmp/sprocket/target/release/sprocket /opt/sprocket/bin/sprocket
ENV PATH=/opt/sprocket/bin:$PATH
ENTRYPOINT ["sprocket"]
CMD ["--help"]