mirror of
				https://github.com/theoludwig/programming-challenges.git
				synced 2025-09-11 23:11:21 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			477 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			477 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
| FROM rust:1.70.0 AS builder
 | |
| WORKDIR /usr/src/rust_application
 | |
| 
 | |
| # Cache dependencies
 | |
| RUN cargo init --bin ./
 | |
| COPY ./Cargo.* ./
 | |
| RUN cargo build --release && rm --recursive --force ./src ./target/release/deps/rust_application*
 | |
| 
 | |
| # Build application
 | |
| COPY ./ ./
 | |
| RUN cargo build --release
 | |
| 
 | |
| FROM gcr.io/distroless/cc-debian11:latest AS runner
 | |
| WORKDIR /usr/src/rust_application
 | |
| COPY --from=builder /usr/src/rust_application/target/release/rust_application ./
 | |
| CMD ["./rust_application"]
 |