Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bullseye docker image #327

Merged
merged 3 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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