У тебя пробел между "<" и "(",а надо "<("
И sh не умеет "<( some command )"
Dockerfile:
FROM ubuntu:latest
RUN apt update && apt install -y openssl
RUN mkdir -p /etc/cert
RUN /bin/bash -c "openssl req -x509 \
-newkey rsa:2048 -nodes -sha256 \
-out /etc/cert/localhost.crt \
-keyout /etc/cert/localhost.key \
-subj '/CN=localhost' \
-extensions EXT \
-config <( \
printf '[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth')"
docker build .
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM ubuntu:latest
---> 1318b700e415
Step 2/4 : RUN apt update && apt install -y openssl
---> Using cache
---> e608bba6cb59
Step 3/4 : RUN mkdir -p /etc/cert
---> Using cache
---> b89d4c7495a3
Step 4/4 : RUN /bin/bash -c "openssl req -x509 -newkey rsa:2048 -nodes -sha256 -out /etc/cert/localhost.crt -keyout /etc/cert/localhost.key -subj '/CN=localhost' -extensions EXT -config <( printf '[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth')"
---> Running in a4012f6c4893
Generating a RSA private key
................................................+++++
..+++++
writing new private key to '/etc/cert/localhost.key'
-----
Removing intermediate container a4012f6c4893
---> 6ea49c8d9ada
Successfully built 6ea49c8d9ada