mirror of
				https://github.com/dcarrillo/whatismyip.git
				synced 2025-11-04 05:49:09 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			331 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			331 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
FROM golang:1.21-alpine as builder
 | 
						|
 | 
						|
ARG ARG_VERSION
 | 
						|
ENV VERSION $ARG_VERSION
 | 
						|
 | 
						|
WORKDIR /app
 | 
						|
 | 
						|
COPY . .
 | 
						|
 | 
						|
RUN apk add make git upx && make build VERSION=$VERSION \
 | 
						|
    && upx --best --lzma whatismyip
 | 
						|
 | 
						|
# Build final image
 | 
						|
FROM scratch
 | 
						|
 | 
						|
WORKDIR /app
 | 
						|
 | 
						|
COPY --from=builder /app/whatismyip /usr/bin/
 | 
						|
 | 
						|
EXPOSE 8080
 | 
						|
 | 
						|
ENTRYPOINT ["whatismyip"]
 |