Skip to content

Commit

Permalink
Use unprivileged docker image
Browse files Browse the repository at this point in the history
Release https://github.com/DFE-Digital/terraform-modules/releases/tag/v0.36.0
dropped default container capabilities. It included the CHOWN capability
which is required by the nginx image running as root. It caused error:
[emerg] chown("/var/cache/nginx/client_temp", 101) failed (1: Operation not permitted)
And the pod failed to start.

Switch to unprivileged docker image and using a high port to solve the
issue.
  • Loading branch information
saliceti committed Aug 8, 2024
1 parent 7824df8 commit 78135e7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM nginx:1.25.3-alpine3.18-slim
FROM nginxinc/nginx-unprivileged:1.26.1

COPY ./build/ /usr/share/nginx/html
23 changes: 23 additions & 0 deletions terraform/application/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion terraform/application/application.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module "web_application" {
cluster_configuration_map = module.cluster_data.configuration_map
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name
web_port = 80
web_port = 8080
probe_path = "/"

docker_image = var.docker_image
Expand Down

0 comments on commit 78135e7

Please sign in to comment.