mirror of
https://github.com/YGGverse/agate.git
synced 2026-04-08 12:35:28 +00:00
Refactor Dockerfile for multi-stage build
This commit is contained in:
parent
dbd6eab17f
commit
fcbf73dcef
4 changed files with 30 additions and 11 deletions
18
Dockerfile
Normal file
18
Dockerfile
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
FROM docker.io/library/rust:alpine AS builder
|
||||
# RUN wget -O source.tar.gz $(wget -qO- https://api.github.com/repos/mbrubeck/agate/releases/latest | sed -nE 's/^.*"tarball_url"\s*:\s*"([^"]+)".*$/\1/p')&& tar xzf source.tar.gz && \
|
||||
# mv mbrubeck-agate-* /agate
|
||||
|
||||
WORKDIR /agate
|
||||
COPY src src
|
||||
COPY Cargo.toml .
|
||||
COPY Cargo.lock .
|
||||
COPY Cross.toml .
|
||||
RUN apk --no-cache add libc-dev && \
|
||||
cargo install --target x86_64-unknown-linux-musl --path .
|
||||
|
||||
FROM docker.io/library/alpine:latest
|
||||
COPY --from=builder /usr/local/cargo/bin/agate /usr/bin/agate
|
||||
WORKDIR /app
|
||||
COPY tools/docker/start.sh /app
|
||||
ENTRYPOINT ["/bin/sh", "start.sh"]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue