mirror of
				https://github.com/dndx/phantun.git
				synced 2025-11-04 03:45:35 +08:00 
			
		
		
		
	- Fix awk delimiter parsing for --tun, --tun-peer, --tun-peer6 arguments - Change shebang from sh to bash to fix signal trap handling - Add missing dependencies (iproute2, iptables, procps) to Dockerfile
		
			
				
	
	
		
			38 lines
		
	
	
		
			768 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			768 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
#
 | 
						|
# Dockerfile for phantun
 | 
						|
#
 | 
						|
 | 
						|
#
 | 
						|
# Build stage
 | 
						|
#
 | 
						|
FROM rust:latest AS builder
 | 
						|
 | 
						|
COPY . /phantun
 | 
						|
 | 
						|
RUN cd phantun \
 | 
						|
  && cargo build --release \
 | 
						|
  && strip target/release/server target/release/client \
 | 
						|
  && install target/release/server /usr/local/bin/phantun-server \
 | 
						|
  && install target/release/client /usr/local/bin/phantun-client \
 | 
						|
  && cd - \
 | 
						|
  && rm -r phantun
 | 
						|
 | 
						|
#
 | 
						|
# Runtime stage
 | 
						|
#
 | 
						|
FROM debian:latest
 | 
						|
 | 
						|
COPY --from=builder /usr/local/bin/phantun-server /usr/local/bin/
 | 
						|
COPY --from=builder /usr/local/bin/phantun-client /usr/local/bin/
 | 
						|
COPY docker/phantun.sh /usr/local/bin/
 | 
						|
RUN apt-get update && apt-get install -y \
 | 
						|
    iproute2 \
 | 
						|
    iptables \
 | 
						|
    procps
 | 
						|
 | 
						|
ENV USE_IPTABLES_NFT_BACKEND=0
 | 
						|
ENV RUST_LOG=INFO
 | 
						|
 | 
						|
ENTRYPOINT ["phantun.sh"]
 | 
						|
CMD ["phantun-server", "--help"]
 |