Skip to content

Commit

Permalink
fixed bullseye docker image (#327)
Browse files Browse the repository at this point in the history
* fixed bullseye docker image and made clean command ignore crt and key files
  • Loading branch information
oliveromahony authored Jun 2, 2023
1 parent fda5ae8 commit e064008
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
build/
**/build/
build/certs/nginx-repo.key
build/certs/nginx-repo.crt
bin/
whitesource/
.vscode/
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ DATE = $(shell date +%F_%H-%M-%S)
# | suse | sles12sp5, sle15 | |
# | freebsd | | Not supported |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
OS_RELEASE ?= ubuntu
OS_VERSION ?= 22.04
OS_RELEASE ?= debian
OS_VERSION ?= bullseye-slim
BASE_IMAGE = "${CONTAINER_REGISTRY}/${OS_RELEASE}:${OS_VERSION}"
IMAGE_TAG = "agent_${OS_RELEASE}_${OS_VERSION}"

Expand Down Expand Up @@ -83,7 +83,7 @@ show-env: $(addprefix show-var-, $(SHOW_ENV_VARS)) ## Show environment
all: clean build run ## Compile and run code.

clean: ## Remove build directory
rm -rf ./build
if [ -d "./build" ]; then find ./build -mindepth 1 ! -path '${CERTS_DIR}/nginx-repo.crt' ! -path '${CERTS_DIR}/nginx-repo.key' -delete; fi

run: ## Run code
go run -ldflags=${LDFLAGS} main.go
Expand Down Expand Up @@ -252,8 +252,8 @@ image: ## Build agent container image for NGINX Plus, need nginx-repo.crt and ng
@echo Building image with $(CONTAINER_CLITOOL); \
$(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) build -t ${IMAGE_TAG} . \
--no-cache -f ./scripts/docker/nginx-plus/${OS_RELEASE}/Dockerfile \
--secret id=nginx-crt,src=build/nginx-repo.crt \
--secret id=nginx-key,src=build/nginx-repo.key \
--secret id=nginx-crt,src=${CERTS_DIR}/nginx-repo.crt \
--secret id=nginx-key,src=${CERTS_DIR}/nginx-repo.key \
--build-arg BASE_IMAGE=${BASE_IMAGE} \
--build-arg PACKAGES_REPO=${PACKAGES_REPO} \
--build-arg OS_RELEASE=${OS_RELEASE} \
Expand Down
7 changes: 5 additions & 2 deletions scripts/docker/nginx-plus/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN --mount=type=secret,id=nginx-crt,dst=/nginx-repo.crt \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
ca-certificates \
gnupg1 \
gnupg \
lsb-release \
&& \
NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; \
Expand Down Expand Up @@ -52,7 +52,10 @@ RUN --mount=type=secret,id=nginx-crt,dst=/nginx-repo.crt \
$nginxPackages \
curl \
gettext-base \
&& apt-get remove --purge -y lsb-release \
&& apt-get autoremove --purge -y \
gnupg \
lsb-release \
&& rm -rf /root/.gnupg \
&& apt-get remove --purge --auto-remove -y && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx-plus.list \
&& rm -rf /etc/apt/apt.conf.d/90nginx /etc/ssl/nginx

Expand Down

0 comments on commit e064008

Please sign in to comment.