Merge pull request #1 from flotte-goes-smart/multistage-docker
Dockerfile: multistage docker imagepull/2/head
commit
a0889e2a0c
@ -1,7 +1,20 @@
|
||||
FROM rust:alpine
|
||||
COPY . .
|
||||
# Build Stage
|
||||
FROM rust:alpine AS builder
|
||||
WORKDIR /usr/src/
|
||||
RUN apk add --no-cache libgcc musl-dev
|
||||
RUN cargo install --path .
|
||||
EXPOSE 8080
|
||||
EXPOSE 5000
|
||||
ENTRYPOINT ["/usr/local/cargo/bin/flotte-user-management"]
|
||||
RUN rustup target add x86_64-unknown-linux-musl
|
||||
|
||||
RUN USER=root cargo new flotte-user-management
|
||||
WORKDIR /usr/src/flotte-user-management
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
|
||||
COPY msg-rpc ./msg-rpc
|
||||
RUN cargo build --release
|
||||
COPY src ./src
|
||||
RUN cargo install --target x86_64-unknown-linux-musl --path .
|
||||
|
||||
# Bundle Stage
|
||||
FROM scratch
|
||||
COPY --from=builder /usr/local/cargo/bin/flotte-user-management .
|
||||
|
||||
ENTRYPOINT ["./flotte-user-management"]
|
Loading…
Reference in New Issue