Updated docker file for better caching
This commit is contained in:
		
							
								
								
									
										25
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -1,11 +1,18 @@
 | 
			
		||||
FROM docker.io/rust:alpine as builder
 | 
			
		||||
WORKDIR /build/pass_manager
 | 
			
		||||
RUN apk -U upgrade --no-cache && apk add --no-cache musl-dev
 | 
			
		||||
COPY . .
 | 
			
		||||
RUN cargo install --path .
 | 
			
		||||
FROM rust:slim AS chef
 | 
			
		||||
RUN cargo install cargo-chef 
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
 | 
			
		||||
FROM docker.io/alpine
 | 
			
		||||
WORKDIR /app/
 | 
			
		||||
RUN apk -U upgrade --no-cache
 | 
			
		||||
COPY --from=builder /usr/local/cargo/bin/pass_manager .
 | 
			
		||||
FROM chef AS planner
 | 
			
		||||
COPY . .
 | 
			
		||||
RUN cargo chef prepare
 | 
			
		||||
 | 
			
		||||
FROM chef AS builder
 | 
			
		||||
COPY --from=planner /app/recipe.json recipe.json
 | 
			
		||||
RUN cargo chef cook --release
 | 
			
		||||
COPY . .
 | 
			
		||||
RUN cargo b -r
 | 
			
		||||
 | 
			
		||||
FROM debian:buster-slim
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
COPY --from=builder /app/target/release/pass_manager .
 | 
			
		||||
CMD [ "./pass_manager" ]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user