@@ -12,14 +12,6 @@ COPY ./packages/opal-server/requires.txt ./server_requires.txt
1212# install python deps
1313RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r ./base_requires.txt -r ./common_requires.txt -r ./client_requires.txt -r ./server_requires.txt
1414
15- # CEDAR AGENT BUILD STAGE ---------------------------
16- # split this stage to save time and reduce image size
17- # ---------------------------------------------------
18- FROM rust:1.79 AS cedar-builder
19- COPY ./cedar-agent /tmp/cedar-agent
20- WORKDIR /tmp/cedar-agent
21- RUN CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse cargo build --release
22-
2315# COMMON IMAGE --------------------------------------
2416# ---------------------------------------------------
2517FROM python:3.10-slim-bookworm AS common
@@ -124,13 +116,18 @@ USER opal
124116# CEDAR CLIENT IMAGE --------------------------------
125117# Using standalone image as base --------------------
126118# ---------------------------------------------------
119+ # Extract the Cedar Agent binary from the existing image
120+ # CEDAR AGENT DOWNLOAD STAGE -----------------------
121+ # Stage to locate and extract the cedar-agent binary
122+ FROM permitio/cedar-agent:0.2.0 AS cedar-extractor
123+
127124FROM client-standalone AS client-cedar
128125
129126# Temporarily move back to root for additional setup
130127USER root
131128
132- # Copy cedar from its build stage
133- COPY --from=cedar-builder /tmp/cedar-agent/target/*/cedar-agent /bin/cedar-agent
129+ COPY --from=cedar-extractor /agent/ cedar-agent /bin/cedar-agent
130+ RUN chmod +x /bin/cedar-agent
134131
135132# enable inline Cedar agent
136133ENV OPAL_POLICY_STORE_TYPE=CEDAR
0 commit comments