Skip to content

Commit 4dc744a

Browse files
author
Asaf Cohen
committed
include maccabi CA certificate in docker image and make sure the certificate is trusted by the container
1 parent d615d71 commit 4dc744a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.github/workflows/pdp_cicd.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616

1717
- name: Set up Docker Buildx
1818
uses: docker/setup-buildx-action@v3
19+
20+
- name: Write maccabi.crt file from secret
21+
run: echo "${{ secrets.MACCABI_CA_FILE }}" > ./maccabi.crt
1922

2023
- uses: actions/checkout@v3
2124
with:
@@ -89,6 +92,9 @@ jobs:
8992
with:
9093
username: ${{ secrets.DOCKERHUB_USERNAME }}
9194
password: ${{ secrets.DOCKERHUB_TOKEN }}
95+
96+
- name: Write maccabi.crt file from secret
97+
run: echo "${{ secrets.MACCABI_CA_FILE }}" > ./maccabi.crt
9298

9399
- name: Pre build - for PDP-Vanilla
94100
run: echo "${{ github.event.release.tag_name }}" | cut -d '-' -f 1 > permit_pdp_version
@@ -133,6 +139,9 @@ jobs:
133139
with:
134140
username: ${{ secrets.DOCKERHUB_USERNAME }}
135141
password: ${{ secrets.DOCKERHUB_TOKEN }}
142+
143+
- name: Write maccabi.crt file from secret
144+
run: echo "${{ secrets.MACCABI_CA_FILE }}" > ./maccabi.crt
136145

137146
- uses: actions/checkout@v3
138147
with:
@@ -171,3 +180,6 @@ jobs:
171180
tags: permitio/pdp-v2:${{ github.event.release.tag_name }},permitio/pdp-v2:latest
172181
cache-from: type=gha
173182
cache-to: type=gha,mode=max
183+
184+
- name: Clean up maccabi.crt file
185+
run: rm ./maccabi.crt

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ RUN adduser -S -s /bin/bash -u 1000 -G permit -h /home/permit permit
3838

3939
# install linux libraries necessary to compile some python packages
4040
RUN apk update && \
41-
apk add --no-cache bash build-base libffi-dev libressl-dev musl-dev zlib-dev gcompat
41+
apk add --no-cache bash build-base libffi-dev libressl-dev musl-dev zlib-dev gcompat ca-certificates
42+
43+
# Copy maccabi.crt into the system certificate store and update the CA store
44+
COPY ./maccabi.crt /usr/local/share/ca-certificates/maccabi.crt
45+
RUN update-ca-certificates
4246

4347
# Copy custom opa binary
4448
RUN mkdir /app/bin

0 commit comments

Comments
 (0)