Skip to content

Commit

Permalink
Refactor labels, pin gomplate
Browse files Browse the repository at this point in the history
  • Loading branch information
nedvna committed Nov 29, 2023
1 parent aaab300 commit 2b36ce2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,25 @@ FROM alpine:${ALPINE_VERSION}

ARG ALPINE_VERSION
ARG NGINX_VERSION
ARG GOMPLATE_VERISON

MAINTAINER Wallarm Support Team <[email protected]>
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 && \
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions build-scripts/apply_fixes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 2b36ce2

Please sign in to comment.