docker icon indicating copy to clipboard operation
docker copied to clipboard

The craftcms/nginx:<ver>-dev images on Docker Hub do not load nitro.conf

Open Kethatril opened this issue 2 years ago • 7 comments

Description

In 1.2.7 the ability to add a nitro.conf file to the root was added and it to be included in the default.conf nginx config. This only fails to work for nginx images 7.3-8.0 however and 7.0-7.2 are fine.

Steps to reproduce

  1. start up a container using any of the craftcms/nginx:-dev images on docker hub (except 7.0-7.2)
  2. ssh into the container and look at the /etc/nginx/conf.d/default.conf file and see it is the production file and doesn't include include /app/*nitro.conf;

You can also inspect the layers of any of those images and see that NGINX_CONF is set to default.conf instead of dev.default.conf

Kethatril avatar Sep 29 '21 00:09 Kethatril

Thanks for reporting – I was able to verify and reproduce this. Just pushed out a new version of the images that should fix this (new images are currently building).

❯ docker run -it --entrypoint cat  craftcms/nginx:8.0-dev /etc/nginx/conf.d/default.conf | grep nitro
    # include custom configuration for nitro
    include     /app/*nitro.conf;

timkelty avatar Sep 29 '21 02:09 timkelty

Hmm, it doesn't look like it worked, the images on docker hub still have the production default.conf

Kethatril avatar Sep 29 '21 19:09 Kethatril

Yeah, I'm debugging the build pipeline…hoping this one will work: https://github.com/craftcms/docker/actions/runs/1287565862

Just takes a while for them to all build. I'll verify with a final test and post here before I close.

timkelty avatar Sep 29 '21 19:09 timkelty

I've figured out the issue, the ARG in the docker file is NGINX_CONF but the build-arg in build-and-push.yml is NGINX_CONFIG

Kethatril avatar Sep 29 '21 19:09 Kethatril

@Kethatril you're my hero. Thanks for the 🕵️ work. Pushing out new images now.

timkelty avatar Sep 29 '21 20:09 timkelty

🤞 https://github.com/craftcms/docker/actions/runs/1288374822

timkelty avatar Sep 29 '21 20:09 timkelty

Took me a bit ha, my brain kept skipping over it. I was sure it was something to do with the build args, but my brain kept insisting that NGINX_CONF was identical to NGINX_CONFIG.

Kethatril avatar Sep 29 '21 20:09 Kethatril