Skip to content

Commit 6679967

Browse files
authored
Include Host Root CAs in Docker Mode (#41)
1 parent a5a5783 commit 6679967

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ init-remote:
8585
echo "$$ACTIVATE_TEMPLATE" >./bin/activate
8686
echo "$$RSH_TEMPLATE" >./bin/rsh
8787
chmod a+x ./bin/rsh
88+
${MAKE} init-remote-${DEVMODE}
8889
${MAKE} sync-once bin/sync
8990
${RSH} sh -ce "echo local > .devmode"
9091
${RSH} make init-env
@@ -94,6 +95,25 @@ init-remote:
9495
.PHONY: init-remote
9596

9697

98+
init-remote-local:
99+
.PHONY: init-remote-local
100+
101+
init-remote-docker:
102+
HOST_CERTS=/tmp/host_certificates.pem; \
103+
case "`uname -s`" in \
104+
Linux) cp /etc/ssl/certs/ca-certificates.crt $$HOST_CERTS;; \
105+
Darwin) security find-certificate -a -p /Library/Keychains/System.keychain > $$HOST_CERTS;; \
106+
*) touch $$HOST_CERTS;; \
107+
esac; \
108+
docker cp $$HOST_CERTS `docker-compose ps -q develop`:/tmp/host_certificates.pem
109+
${RSH} csplit --quiet --prefix=/usr/local/share/ca-certificates/host_certificate_ --suffix='%02d.crt' --elide-empty-files /tmp/host_certificates.pem '/-----BEGIN CERTIFICATE-----/' '{*}'
110+
${RSH} update-ca-certificates
111+
.PHONY: init-remote-docker
112+
113+
init-remote-kube:
114+
.PHONY: init-remote-kube
115+
116+
97117
# Create the environment and install development tools.
98118
init-env:
99119
python3 -m venv ${CURDIR}

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ services:
3939
- npm_config_cache=/cache/npm
4040
- YARN_CACHE_FOLDER=/cache/yarn
4141
- PIP_CACHE_DIR=/cache/pip
42+
- REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
43+
- NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
4244
cap_add:
4345
- NET_ADMIN
4446
sysctls:

0 commit comments

Comments
 (0)