add .gitlab-ci.yml
add Dockerfile
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -1,4 +1,20 @@
|
||||
FROM ubuntu:latest
|
||||
LABEL authors="123ee"
|
||||
FROM rust:1.50 as builder
|
||||
|
||||
ENTRYPOINT ["top", "-b"]
|
||||
WORKDIR /app
|
||||
ARG APP=imspyder
|
||||
|
||||
RUN USER=root cargo new $APP
|
||||
WORKDIR /app/$APP
|
||||
RUN mkdir -p .cargo
|
||||
COPY config.toml .cargo/
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
|
||||
COPY ./src src
|
||||
RUN cargo install --path . --color always
|
||||
|
||||
# Copy the app to an base Docker image, here we use distroless
|
||||
FROM alpine:latest
|
||||
RUN mkdir -p /cache
|
||||
COPY --from=builder /usr/local/cargo/bin/$APP /$APP
|
||||
USER 1000
|
||||
ENTRYPOINT ["/$APP"]
|
||||
Reference in New Issue
Block a user