Commit 5ecb79c3 authored by nanamicat's avatar nanamicat

docker

parent 1f73ae2b
Pipeline #42039 failed with stages
in 10 seconds
# Rust build artifacts
target/
# Git
.git/
.gitignore
# IDE
.idea/
# CI/CD
.gitlab-ci.yml
# Docker
Dockerfile
.dockerignore
# Documentation
README.md
rustfmt.toml
entrypoint.sh
\ No newline at end of file
FROM rust:1.91-alpine3.22 as chef
RUN apk add --no-cache musl-dev
FROM rust:1.92-alpine3.23 AS chef
RUN cargo install cargo-chef
WORKDIR /usr/src/app
WORKDIR app
FROM chef as planner
COPY Cargo.toml Cargo.lock ./
COPY src src
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef as builder
COPY --from=planner /usr/src/app/recipe.json recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY Cargo.toml Cargo.lock ./
COPY src src
COPY . .
RUN cargo build --release
FROM alpine:3.22
RUN apk --no-cache add libgcc libstdc++ bash iproute2 iptables iptables-legacy ipset netcat-openbsd jq
COPY --from=builder /usr/src/app/target/release/tun1 /usr/local/bin/tun
RUN apk --no-cache add bash iproute2 iptables iptables-legacy ipset netcat-openbsd jq
COPY --from=builder /app/target/release/tun1 /usr/local/bin/tun
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment