diff --git a/Dockerfile b/Dockerfile index b1acee9..6cd5d1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,17 +4,25 @@ FROM alpine:${ALPINE_VERSION} ARG ALPINE_VERSION ARG NGINX_VERSION +ARG GOMPLATE_VERISON MAINTAINER Wallarm Support Team -LABEL NGINX_VERSION=${NGINX_VERSION} -LABEL AIO_VERSION=${AIO_VERSION} + +LABEL org.opencontainers.image.title="Docker official image for Wallarm Node. API security platform agent" +LABEL org.opencontainers.image.documentation="https://docs.wallarm.com/installation/inline/compute-instances/docker/nginx-based" +LABEL org.opencontainers.image.source="https://github.com/wallarm/docker-wallarm-node" +LABEL org.opencontainers.image.vendor="Wallarm" +LABEL org.opencontainers.image.version="${AIO_VERSION}" +LABEL org.opencontainers.image.revision="${CONTAINER_VERSION}" +LABEL com.wallarm.docker.versions.alpine-version="${ALPINE_VERSION}" +LABEL com.wallarm.docker.versions.nginx-version="${NGINX_VERSION}" # core deps RUN addgroup -S wallarm && \ adduser -S -D -G wallarm -h /opt/wallarm wallarm && \ apk update && \ apk upgrade && \ - apk add curl bash socat logrotate libgcc gomplate && \ + apk add curl bash socat logrotate libgcc "gomplate=~${GOMPLATE_VERISON}" && \ curl -o /etc/apk/keys/nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub && \ apk add -X "https://nginx.org/packages/mainline/alpine/v${ALPINE_VERSION}/main" "nginx=~${NGINX_VERSION}" "nginx-module-geoip=~${NGINX_VERSION}" "nginx-module-image-filter=~${NGINX_VERSION}" "nginx-module-perl=~${NGINX_VERSION}" "nginx-module-xslt=~${NGINX_VERSION}" && \ nginx -v && \ diff --git a/Makefile b/Makefile index 5ad7929..3635e93 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ CONTAINER_VERSION ?= test ALPINE_VERSION = 3.18 NGINX_VERSION = 1.25.3 WLRM_FOLDER = mainline-$(shell echo ${NGINX_VERSION} | sed 's/\.//g') +GOMPLATE_VERISON = 3.11.5 REGISTRY := docker.io/wallarm IMAGE ?= $(REGISTRY)/node:$(CONTAINER_VERSION) @@ -52,7 +53,7 @@ endif .PHONY: build build: setup_buildx $(foreach ARCH,$(ARCHS), ARCH=$(ARCH) build-scripts/get_dependencies.sh && ARCH=$(ARCH) build-scripts/apply_fixes.sh ;) - docker buildx build --platform $(PLATFORMS) -f Dockerfile --build-arg ALPINE_VERSION="$(ALPINE_VERSION)" --build-arg NGINX_VERSION="$(NGINX_VERSION)" --build-arg AIO_VERSION="$(AIO_VERSION)" --build-arg WLRM_FOLDER="$(WLRM_FOLDER)" -t $(IMAGE) $(BUILDX_ARGS) . + docker buildx build --platform $(PLATFORMS) -f Dockerfile --build-arg CONTAINER_VERSION="$(CONTAINER_VERSION)" --build-arg GOMPLATE_VERISON="$(GOMPLATE_VERISON)" --build-arg ALPINE_VERSION="$(ALPINE_VERSION)" --build-arg NGINX_VERSION="$(NGINX_VERSION)" --build-arg AIO_VERSION="$(AIO_VERSION)" --build-arg WLRM_FOLDER="$(WLRM_FOLDER)" -t $(IMAGE) $(BUILDX_ARGS) . setup_buildx: docker buildx rm multi-arch || true diff --git a/build-scripts/apply_fixes.sh b/build-scripts/apply_fixes.sh index be12e6f..93f1438 100755 --- a/build-scripts/apply_fixes.sh +++ b/build-scripts/apply_fixes.sh @@ -10,9 +10,9 @@ fi BUILD_DIR="build/linux/${DOCKER_ARCH}" -sed -i \ - -e '/WALLARM_COMPONENT_NAME/d' \ - -e '/WALLARM_COMPONENT_VERSION/d' \ +sed -i -E \ + -e '/WALLARM_COMPONENT_NAME/s/(.*)=(.*)/\1=wallarm_nginx_docker/' \ + -e "/WALLARM_COMPONENT_VERSION/s/(.*)=(.*)/\1=$AIO_VERSION/" \ -e '/SLAB_ALLOC_ARENA/d' \ "$BUILD_DIR/opt/wallarm/env.list"