mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-02-24 01:38:15 +00:00
build: get Forego from pre-built image
This commit is contained in:
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
|
FROM nginxproxy/docker-gen:0.10.4-debian AS docker-gen
|
||||||
|
|
||||||
# Build forego from scratch
|
FROM nginxproxy/forego:0.17.1-debian AS forego
|
||||||
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
|
|
||||||
|
|
||||||
# Build the final image
|
# Build the final image
|
||||||
FROM nginx:1.23.4
|
FROM nginx:1.23.4
|
||||||
@ -35,7 +19,6 @@ RUN apt-get update \
|
|||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -r /var/lib/apt/lists/*
|
&& rm -r /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
# Configure Nginx
|
# Configure Nginx
|
||||||
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
|
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
|
||||||
&& sed -i 's/worker_processes 1/worker_processes auto/' /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
|
FROM nginxproxy/docker-gen:0.10.4 AS docker-gen
|
||||||
|
|
||||||
# Build forego from scratch
|
FROM nginxproxy/forego:0.17.1 AS forego
|
||||||
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
|
|
||||||
|
|
||||||
# Build the final image
|
# Build the final image
|
||||||
FROM nginx:1.23.4-alpine
|
FROM nginx:1.23.4-alpine
|
||||||
|
Loading…
x
Reference in New Issue
Block a user