Skip to content

Commit 85d8358

Browse files
committed
Move alpine base Dockerfiles back to build dir
1 parent 2e9bac0 commit 85d8358

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ NJS_DIR = internal/controller/nginx/modules/src
77
KIND_CONFIG_FILE = $(SELF_DIR)config/cluster/kind-cluster.yaml
88
NGINX_DOCKER_BUILD_PLUS_ARGS = --secret id=nginx-repo.crt,src=$(SELF_DIR)nginx-repo.crt --secret id=nginx-repo.key,src=$(SELF_DIR)nginx-repo.key
99
BUILD_AGENT = local
10-
BASE_IMAGE ?= nginx:1.29.1-alpine-otel
1110

1211
PROD_TELEMETRY_ENDPOINT = oss.edge.df.f5.com:443
1312
# the telemetry related variables below are also configured in goreleaser.yml
@@ -44,7 +43,7 @@ HELM_SCHEMA_VERSION = 0.18.1
4443
PREFIX ?= nginx-gateway-fabric## The name of the NGF image. For example, nginx-gateway-fabric
4544
NGINX_PREFIX ?= $(PREFIX)/nginx## The name of the nginx image. For example: nginx-gateway-fabric/nginx
4645
NGINX_PLUS_PREFIX ?= $(PREFIX)/nginx-plus## The name of the nginx plus image. For example: nginx-gateway-fabric/nginx-plus
47-
BUILD_OS ?= alpine## The OS of the nginx image. Possible values: alpine and ubi
46+
BUILD_OS ?= ## The OS of the nginx image. Possible values: alpine and ubi
4847
IMAGE_PULL_POLICY ?= Never## The image pull policy for the NGF and nginx images. Possible values: Always, Never, IfNotPresent
4948
TAG ?= $(VERSION:v%=%)## The tag of the image. For example, 1.1.0
5049
TARGET ?= local## The target of the build. Possible values: local and container
@@ -86,21 +85,21 @@ build-prod-ngf-image: build-ngf-image ## Build the NGF docker image for producti
8685

8786
.PHONY: build-ngf-image
8887
build-ngf-image: check-for-docker build ## Build the NGF docker image
89-
docker build --platform linux/$(GOARCH) --build-arg BUILD_AGENT=$(BUILD_AGENT) --target $(strip $(TARGET)) -f $(SELF_DIR)build/$(BUILD_OS)/Dockerfile -t $(strip $(PREFIX)):$(strip $(TAG)) $(strip $(SELF_DIR))
88+
docker build --platform linux/$(GOARCH) --build-arg BUILD_AGENT=$(BUILD_AGENT) --target $(strip $(TARGET)) -f $(SELF_DIR)build/$(if $(BUILD_OS),$(BUILD_OS)/)Dockerfile -t $(strip $(PREFIX)):$(strip $(TAG)) $(strip $(SELF_DIR))
9089

9190
.PHONY: build-prod-nginx-image
9291
build-prod-nginx-image: build-nginx-image ## Build the custom nginx image for production
9392

9493
.PHONY: build-nginx-image
9594
build-nginx-image: check-for-docker ## Build the custom nginx image
96-
docker build --platform linux/$(GOARCH) $(strip $(NGINX_DOCKER_BUILD_OPTIONS)) -f $(SELF_DIR)build/$(BUILD_OS)/Dockerfile.nginx -t $(strip $(NGINX_PREFIX)):$(strip $(TAG)) $(strip $(SELF_DIR))
95+
docker build --platform linux/$(GOARCH) $(strip $(NGINX_DOCKER_BUILD_OPTIONS)) -f $(SELF_DIR)build/$(if $(BUILD_OS),$(BUILD_OS)/)Dockerfile.nginx -t $(strip $(NGINX_PREFIX)):$(strip $(TAG)) $(strip $(SELF_DIR))
9796

9897
.PHONY: build-prod-nginx-plus-image
9998
build-prod-nginx-plus-image: build-nginx-plus-image ## Build the custom nginx plus image for production
10099

101100
.PHONY: build-nginx-plus-image
102101
build-nginx-plus-image: check-for-docker ## Build the custom nginx plus image
103-
docker build --platform linux/$(GOARCH) $(strip $(NGINX_DOCKER_BUILD_OPTIONS)) $(strip $(NGINX_DOCKER_BUILD_PLUS_ARGS)) -f $(SELF_DIR)build/$(BUILD_OS)/Dockerfile.nginxplus -t $(strip $(NGINX_PLUS_PREFIX)):$(strip $(TAG)) $(strip $(SELF_DIR))
102+
docker build --platform linux/$(GOARCH) $(strip $(NGINX_DOCKER_BUILD_OPTIONS)) $(strip $(NGINX_DOCKER_BUILD_PLUS_ARGS)) -f $(SELF_DIR)build/$(if $(BUILD_OS),$(BUILD_OS)/)Dockerfile.nginxplus -t $(strip $(NGINX_PLUS_PREFIX)):$(strip $(TAG)) $(strip $(SELF_DIR))
104103

105104
.PHONY: check-for-docker
106105
check-for-docker: ## Check if Docker is installed
File renamed without changes.
File renamed without changes.
File renamed without changes.

build/ubi/Dockerfile.nginx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ RUN mkdir -p /usr/lib/nginx/modules /var/run/nginx /usr/lib64/nginx/modules \
5454
# Forward request and error logs to docker log collector
5555
&& ln -sf /dev/stdout /var/log/nginx/access.log \
5656
&& ln -sf /dev/stderr /var/log/nginx/error.log \
57-
&& cp -r /usr/lib64/nginx/modules/ngx_* /usr/lib/nginx/modules/ \
57+
&& mv /usr/lib64/nginx/modules/ngx_* /usr/lib/nginx/modules/ \
5858
# Set proper permissions for nginx user
5959
&& chown -R 101:1001 /etc/nginx /var/cache/nginx /var/log/nginx /var/run/nginx
6060

build/ubi/Dockerfile.nginxplus

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ RUN mkdir -p /usr/lib/nginx/modules /var/run/nginx /usr/lib64/nginx/modules \
5959
# Forward request and error logs to docker log collector
6060
&& ln -sf /dev/stdout /var/log/nginx/access.log \
6161
&& ln -sf /dev/stderr /var/log/nginx/error.log \
62-
&& cp -r /usr/lib64/nginx/modules/ngx_* /usr/lib/nginx/modules/ \
62+
&& mv /usr/lib64/nginx/modules/ngx_* /usr/lib/nginx/modules/ \
6363
# Set proper permissions for nginx user
6464
&& chown -R 101:1001 /etc/nginx /var/cache/nginx /var/log/nginx /var/run/nginx
6565

0 commit comments

Comments
 (0)