Ваш шаг 3 включает в себя bashism:
mkdir -p /etc/nginx/{sites-available,sites-enabled}
При использовании по умолчанию / bin / sh это создаст один каталог, а не два требуемых каталога:
$ docker run -it --rm nginx /bin/sh
# ls -al /etc/nginx
total 48
drwxr-xr-x 3 root root 4096 Dec 28 15:20 .
drwxr-xr-x 1 root root 4096 Jan 26 19:46 ..
drwxr-xr-x 2 root root 4096 Dec 28 15:20 conf.d
-rw-r--r-- 1 root root 1007 Nov 19 12:50 fastcgi_params
-rw-r--r-- 1 root root 2837 Nov 19 12:50 koi-utf
-rw-r--r-- 1 root root 2223 Nov 19 12:50 koi-win
-rw-r--r-- 1 root root 5231 Nov 19 12:50 mime.types
lrwxrwxrwx 1 root root 22 Nov 19 12:50 modules -> /usr/lib/nginx/modules
-rw-r--r-- 1 root root 643 Nov 19 12:50 nginx.conf
-rw-r--r-- 1 root root 636 Nov 19 12:50 scgi_params
-rw-r--r-- 1 root root 664 Nov 19 12:50 uwsgi_params
-rw-r--r-- 1 root root 3610 Nov 19 12:50 win-utf
# mkdir -p /etc/nginx/{sites-available,sites-enabled}
# ls -al /etc/nginx
total 56
drwxr-xr-x 1 root root 4096 Jan 26 19:47 .
drwxr-xr-x 1 root root 4096 Jan 26 19:46 ..
drwxr-xr-x 2 root root 4096 Dec 28 15:20 conf.d
-rw-r--r-- 1 root root 1007 Nov 19 12:50 fastcgi_params
-rw-r--r-- 1 root root 2837 Nov 19 12:50 koi-utf
-rw-r--r-- 1 root root 2223 Nov 19 12:50 koi-win
-rw-r--r-- 1 root root 5231 Nov 19 12:50 mime.types
lrwxrwxrwx 1 root root 22 Nov 19 12:50 modules -> /usr/lib/nginx/modules
-rw-r--r-- 1 root root 643 Nov 19 12:50 nginx.conf
-rw-r--r-- 1 root root 636 Nov 19 12:50 scgi_params
-rw-r--r-- 1 root root 664 Nov 19 12:50 uwsgi_params
-rw-r--r-- 1 root root 3610 Nov 19 12:50 win-utf
drwxr-xr-x 2 root root 4096 Jan 26 19:47 {sites-available,sites-enabled}
Для / bin / sh необходимо перечислить их по отдельности:
# mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled
# ls -al /etc/nginx
total 64
drwxr-xr-x 1 root root 4096 Jan 26 19:49 .
drwxr-xr-x 1 root root 4096 Jan 26 19:46 ..
drwxr-xr-x 2 root root 4096 Dec 28 15:20 conf.d
-rw-r--r-- 1 root root 1007 Nov 19 12:50 fastcgi_params
-rw-r--r-- 1 root root 2837 Nov 19 12:50 koi-utf
-rw-r--r-- 1 root root 2223 Nov 19 12:50 koi-win
-rw-r--r-- 1 root root 5231 Nov 19 12:50 mime.types
lrwxrwxrwx 1 root root 22 Nov 19 12:50 modules -> /usr/lib/nginx/modules
-rw-r--r-- 1 root root 643 Nov 19 12:50 nginx.conf
-rw-r--r-- 1 root root 636 Nov 19 12:50 scgi_params
drwxr-xr-x 2 root root 4096 Jan 26 19:49 sites-available
drwxr-xr-x 2 root root 4096 Jan 26 19:49 sites-enabled
-rw-r--r-- 1 root root 664 Nov 19 12:50 uwsgi_params
-rw-r--r-- 1 root root 3610 Nov 19 12:50 win-utf
drwxr-xr-x 2 root root 4096 Jan 26 19:47 {sites-available,sites-enabled}