2

Running nodejs express app with letsencrypt certs for HTTPS. CAN'T find a way to conditionally copy the generated certs folder it exists (exists on remote EC2 - not localy)

Docker version 20.10.7, build f0df350

Tried this 2 solution and can't make it to work

First solution suggestions

docker build -t server .

COPY ./certs*/ ./certs/

result

Step 3/15 : COPY ./certs*/ ./certs/
COPY failed: no source files were specified

Second solution suggestions

docker build -t server .

COPY *sometimes_exist_on_host.txt .

result

Step 3/15 : COPY *privkey.pem .
COPY failed: no source files were specified
Eyal Solomon
  • 470
  • 1
  • 6
  • 15
  • You should probably use a `docker run -v` option or something similar to inject the certificates. You really don't want to copy these certificates into your image as you're showing: anyone who gets a copy of the image can trivially extract them and impersonate your site. – David Maze Mar 17 '22 at 20:25

0 Answers0