Skip to content

Commit

Permalink
Use official Rust base image instead of muslrust to prevent DNS errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradHoeffner committed Sep 12, 2023
1 parent 64bbbdb commit 90a4142
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# syntax=docker/dockerfile:1
FROM clux/muslrust:1.73.0-nightly-2023-08-01 AS chef
FROM rust:1 AS chef
USER root
RUN rustup toolchain install nightly && rustup default nightly
RUN cargo install cargo-chef
WORKDIR /app

Expand All @@ -12,14 +13,14 @@ RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
ARG CARGO_INCREMENTAL=0
COPY --link --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN cargo build --release --target x86_64-unknown-linux-musl
RUN cargo build --release --bin rickview

FROM busybox AS runtime
RUN addgroup -S myuser && adduser -S myuser -G myuser
COPY --link --from=builder /app/target/x86_64-unknown-linux-musl/release/rickview /usr/local/bin/
USER myuser
#FROM alpine AS runtime
#RUN apk add libgcc
FROM debian:stable-slim AS runtime
COPY --link --from=builder /app/target/release/rickview /usr/local/bin/rickview
WORKDIR /app
RUN mkdir -p data && touch data/kb.ttl
CMD ["/usr/local/bin/rickview"]

0 comments on commit 90a4142

Please sign in to comment.