Updated docker file for better caching
This commit is contained in:
		
							
								
								
									
										27
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -1,11 +1,18 @@
 | 
				
			|||||||
FROM docker.io/rust:alpine as builder
 | 
					FROM rust:slim AS chef
 | 
				
			||||||
WORKDIR /build/pass_manager
 | 
					RUN cargo install cargo-chef 
 | 
				
			||||||
RUN apk -U upgrade --no-cache && apk add --no-cache musl-dev
 | 
					WORKDIR /app
 | 
				
			||||||
COPY . .
 | 
					 | 
				
			||||||
RUN cargo install --path .
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM docker.io/alpine
 | 
					FROM chef AS planner
 | 
				
			||||||
WORKDIR /app/
 | 
					COPY . .
 | 
				
			||||||
RUN apk -U upgrade --no-cache
 | 
					RUN cargo chef prepare
 | 
				
			||||||
COPY --from=builder /usr/local/cargo/bin/pass_manager .
 | 
					
 | 
				
			||||||
CMD ["./pass_manager"]
 | 
					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