Skip to content

Commit

Permalink
set pccs in docker build
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Vavala <bruno.vavala@intel.com>
  • Loading branch information
bvavala committed Oct 22, 2022
1 parent 14c4af7 commit e9e4ea9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker/Dockerfile.pdo-dev
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ ARG SGX=2.15.1
ARG OPENSSL=1.1.1g
ARG SGXSSL=2.10_1.1.1g

ARG PCCS_HOSTPORT=localhost:8081
ENV PCCS_HOSTPORT=${PCCS_HOSTPORT}

ARG ADD_APT_PKGS=

# Add necessary packages
Expand Down Expand Up @@ -165,6 +168,8 @@ RUN apt-get install -y \

# Disable certificate check for PCCS
RUN sed -i "s/true/false/g" /etc/sgx_default_qcnl.conf
# set the PCCS URL provided as input
RUN sed -i "s/localhost:8081/${PCCS_HOSTPORT}/g" /etc/sgx_default_qcnl.conf

# Install SGX SDK
RUN mkdir -p /opt/intel
Expand Down
5 changes: 5 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,18 @@ ifeq ($(SGX_MODE),HW)
ifeq ($(SGX_ATTESTATION_TYPE),epid-linkable)
SGX_DEVICE_PATH=$(shell if [ -e "/dev/isgx" ]; then echo "/dev/isgx"; elif [ -e "/dev/sgx/enclave" ]; then echo "/dev/sgx/enclave"; else echo "ERROR: NO SGX DEVICE FOUND"; fi)
endif

ifeq ($(SGX_ATTESTATION_TYPE),dcap)
SGX_DEVICE_PATH=$(shell if [ -e "/dev/sgx_enclave" ]; then echo "/dev/sgx_enclave"; else echo "ERROR: NO SGX DEVICE FOUND"; fi)
SGX_PROVISION_DEVICE_PATH=$(shell if [ -e "/dev/sgx_provision" ]; then echo "/dev/sgx_provision"; else echo "ERROR: NO SGX PROV DEVICE FOUND"; fi)
# set pccs url: grab from env, or assume it's in the local host listening on 8081
PCCS_HOSTPORT:=$(if $(PCCS_HOSTPORT),$(PCCS_HOSTPORT),$(shell hostname -A | cut -d" " -f1):8081)
DOCKER_BUILD_OPTS := ${DOCKER_BUILD_OPTS} --build-arg PCCS_HOSTPORT=${PCCS_HOSTPORT}
endif

DOCKER_COMPOSE_COMMAND := env SGX_DEVICE_PATH=${SGX_DEVICE_PATH} env SGX_PROVISION_DEVICE_PATH=${SGX_PROVISION_DEVICE_PATH} ${DOCKER_COMPOSE_COMMAND}
endif

ifdef http_proxy
DO_PROXY = 1
endif
Expand Down

0 comments on commit e9e4ea9

Please sign in to comment.