Hello
As on-premise installation, we are adding our self signed certificates to the docker image, and found that docker image building failed at copying the certificates.
What we have done is:
- put the self-signed certificate file at the folder of sentry
- during docker image build, try to trust this certificate
- For debug, we have listed all files during the installation to ensure the file existance.
Here is our installation log:
Pulling snuba-cleanup ... done
Pulling symbolicator ... pulling from getsentry/symbolicator
Pulling symbolicator ... digest: sha256:adbb9b87150a1abf66...
Pulling symbolicator ... status: image is up to date for g...
Pulling symbolicator ... done
Pulling smtp ... pulling from tianon/exim4
Pulling smtp ... digest: sha256:f01923e8154add4b30...
Pulling smtp ... status: image is up to date for t...
Pulling smtp ... done
Pulling redis ... digest: sha256:49a9889fc47003cc8b...
Pulling redis ... status: image is up to date for r...
Pulling redis ... done
latest: Pulling from getsentry/sentry
Digest: sha256:bb80d4c92c50cee042dbf0064a6b9d48a4e63f1274d5c7b8c9886e55d354c8e7
Status: Image is up to date for getsentry/sentry:latest
docker.io/getsentry/sentry:latest
checking files in sentry
ζ»η¨ι 24
-rw-r--r-- 1 root root 2536 3ζ 22 08:13 config.yml
-rw-r--r-- 1 root root 382 3ζ 23 11:42 Dockerfile
-rw-r--r-- 1 root root 62 3ζ 22 08:13 requirements.txt
-rw-r--r-- 1 root root 3691 3ζ 23 09:50 self-signed.crt
-rw-r--r-- 1 root root 5886 3ζ 22 09:36 sentry.conf.py
Building web
Step 1/5 : ARG SENTRY_IMAGE
Step 2/5 : FROM ${SENTRY_IMAGE:-getsentry/sentry:latest}
---> d1a5c1fc62f4
Step 3/5 : COPY . /usr/src/sentry
---> e044f8411b9f
Step 4/5 : RUN ls -l /usr/src/sentry && mv /usr/src/sentry/self-signed.crt /user/local/share/ca-certificates/self-signed.crt && update-ca-certificates
---> Running in 9d571145e987
total 4
-rw-r--r-- 1 root root 62 Mar 22 00:13 requirements.txt
mv: cannot stat '/usr/src/sentry/self-signed.crt': No such file or directory
Removing intermediate container 9d571145e987
Service 'web' failed to build: The command '/bin/sh -c ls -l /usr/src/sentry && mv /usr/src/sentry/self-signed.crt /user/local/share/ca-certificates/self-signed.crt && update-ca-certificates' returned a non-zero code: 1
Cleaning up...
We can see that our self-signed.crt
file is together with requirements.txt
, but by a docker command COPY . /usr/src/sentry
, it seems only file requirements.txt
is correctly copied.
So we are wonder:
- why the docker only copied
requirements.txt
file and ignore others ? - and what is the best practice to trust self-signed certificate during docker image building?
B.R.
Liang