mirror of
				https://github.com/thib8956/nginx-proxy
				synced 2025-11-03 18:49:20 +00:00 
			
		
		
		
	build: get Forego from pre-built image
This commit is contained in:
		
				
					committed by
					
						
						Richard Hansen
					
				
			
			
				
	
			
			
			
						parent
						
							068bf91e83
						
					
				
				
					commit
					5d237b7a0a
				
			
							
								
								
									
										19
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -1,22 +1,6 @@
 | 
			
		||||
# setup build arguments for version of dependencies to use
 | 
			
		||||
ARG FOREGO_VERSION=v0.17.0
 | 
			
		||||
 | 
			
		||||
FROM nginxproxy/docker-gen:0.10.4-debian AS docker-gen
 | 
			
		||||
 | 
			
		||||
# Build forego from scratch
 | 
			
		||||
FROM golang:1.20.4 as forego
 | 
			
		||||
 | 
			
		||||
ARG FOREGO_VERSION
 | 
			
		||||
 | 
			
		||||
RUN git clone https://github.com/nginx-proxy/forego/ \
 | 
			
		||||
   && cd /go/forego \
 | 
			
		||||
   && git -c advice.detachedHead=false checkout $FOREGO_VERSION \
 | 
			
		||||
   && go mod download \
 | 
			
		||||
   && CGO_ENABLED=0 GOOS=linux go build -o forego . \
 | 
			
		||||
   && go clean -cache \
 | 
			
		||||
   && mv forego /usr/local/bin/ \
 | 
			
		||||
   && cd - \
 | 
			
		||||
   && rm -rf /go/forego
 | 
			
		||||
FROM nginxproxy/forego:0.17.1-debian AS forego
 | 
			
		||||
 | 
			
		||||
# Build the final image
 | 
			
		||||
FROM nginx:1.23.4
 | 
			
		||||
@@ -35,7 +19,6 @@ RUN apt-get update \
 | 
			
		||||
   && apt-get clean \
 | 
			
		||||
   && rm -r /var/lib/apt/lists/*
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Configure Nginx
 | 
			
		||||
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
 | 
			
		||||
   && sed -i 's/worker_processes  1/worker_processes  auto/' /etc/nginx/nginx.conf \
 | 
			
		||||
 
 | 
			
		||||
@@ -1,23 +1,6 @@
 | 
			
		||||
# setup build arguments for version of dependencies to use
 | 
			
		||||
ARG FOREGO_VERSION=v0.17.0
 | 
			
		||||
 | 
			
		||||
FROM nginxproxy/docker-gen:0.10.4 AS docker-gen
 | 
			
		||||
 | 
			
		||||
# Build forego from scratch
 | 
			
		||||
FROM golang:1.20.4-alpine as forego
 | 
			
		||||
 | 
			
		||||
ARG FOREGO_VERSION
 | 
			
		||||
 | 
			
		||||
RUN apk add --no-cache git musl-dev \
 | 
			
		||||
   && git clone https://github.com/nginx-proxy/forego/ \
 | 
			
		||||
   && cd /go/forego \
 | 
			
		||||
   && git -c advice.detachedHead=false checkout $FOREGO_VERSION \
 | 
			
		||||
   && go mod download \
 | 
			
		||||
   && CGO_ENABLED=0 go build -o forego . \
 | 
			
		||||
   && go clean -cache \
 | 
			
		||||
   && mv forego /usr/local/bin/ \
 | 
			
		||||
   && cd - \
 | 
			
		||||
   && rm -rf /go/forego
 | 
			
		||||
FROM nginxproxy/forego:0.17.1 AS forego
 | 
			
		||||
 | 
			
		||||
# Build the final image
 | 
			
		||||
FROM nginx:1.23.4-alpine
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user