Skip to content

Commit 1314349

Browse files
authored
Merge pull request #922 from intel/docker_build_fix
PSW: fix docker build and psw bin installer for urts version update
2 parents 2fef5c1 + a504531 commit 1314349

File tree

7 files changed

+95
-9
lines changed

7 files changed

+95
-9
lines changed

docker/build/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ RUN make sdk_install_pkg_no_mitigation
5959
WORKDIR /opt/intel
6060
RUN sh -c 'echo yes | /linux-sgx/linux/installer/bin/sgx_linux_x64_sdk_*.bin'
6161

62+
ENV SGX_SDK=/opt/intel/sgxsdk
6263
WORKDIR /linux-sgx
6364
RUN make psw_install_pkg
6465

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (C) 2022 Intel Corporation. All rights reserved.
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions
7+
# are met:
8+
#
9+
# * Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
# * Redistributions in binary form must reproduce the above copyright
12+
# notice, this list of conditions and the following disclaimer in
13+
# the documentation and/or other materials provided with the
14+
# distribution.
15+
# * Neither the name of Intel Corporation nor the names of its
16+
# contributors may be used to endorse or promote products derived
17+
# from this software without specific prior written permission.
18+
#
19+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
#
31+
32+
set -e
33+
docker build --target aesm_deb --build-arg https_proxy=$https_proxy \
34+
--build-arg http_proxy=$http_proxy -t sgx_aesm_deb -f ./Dockerfile ../../
35+
36+
docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=rw aesmd-socket
37+
38+
# If you use the Legacy Launch Control driver, replace /dev/sgx_enclave with /dev/isgx, and remove
39+
# --device=/dev/sgx_provision
40+
41+
docker run --env http_proxy --env https_proxy --device=/dev/sgx_enclave --device=/dev/sgx_provision -v /dev/log:/dev/log -v aesmd-socket:/var/run/aesmd -it sgx_aesm_deb

docker/build/build_and_run_aesm_docker.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ docker build --target aesm --build-arg https_proxy=$https_proxy \
3535

3636
docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=rw aesmd-socket
3737

38-
# If you use the Legacy Launch Control driver, replace /dev/sgx/enclave with /dev/isgx, and remove
39-
# --device=/dev/sgx/provision
38+
# If you use the Legacy Launch Control driver, replace /dev/sgx_enclave with /dev/isgx, and remove
39+
# --device=/dev/sgx_provision
4040

41-
docker run --env http_proxy --env https_proxy --device=/dev/sgx/enclave --device=/dev/sgx/provision -v /dev/log:/dev/log -v aesmd-socket:/var/run/aesmd -it sgx_aesm
41+
docker run --env http_proxy --env https_proxy --device=/dev/sgx_enclave --device=/dev/sgx_provision -v /dev/log:/dev/log -v aesmd-socket:/var/run/aesmd -it sgx_aesm

docker/build/build_and_run_qgs_docker.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ docker build --target qgs --build-arg https_proxy=$https_proxy \
3535

3636
docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=rw qgs-socket
3737

38-
# If you use the Legacy Launch Control driver, replace /dev/sgx/enclave with /dev/isgx, and remove
39-
# --device=/dev/sgx/provision
38+
# If you use the Legacy Launch Control driver, replace /dev/sgx_enclave with /dev/isgx, and remove
39+
# --device=/dev/sgx_provision
4040

41-
docker run --device=/dev/sgx/enclave --device=/dev/sgx/provision -v /dev/log:/dev/log -v qgs-socket:/var/run/tdx-qgs/ -it --add-host=host.docker.internal:host-gateway tdx_qgs /opt/intel/tdx-qgs/qgs --no-daemon
41+
docker run --device=/dev/sgx_enclave --device=/dev/sgx_provision -v /dev/log:/dev/log -v qgs-socket:/var/run/tdx-qgs/ -it --add-host=host.docker.internal:host-gateway tdx_qgs /opt/intel/tdx-qgs/qgs --no-daemon
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (C) 2022 Intel Corporation. All rights reserved.
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions
7+
# are met:
8+
#
9+
# * Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
# * Redistributions in binary form must reproduce the above copyright
12+
# notice, this list of conditions and the following disclaimer in
13+
# the documentation and/or other materials provided with the
14+
# distribution.
15+
# * Neither the name of Intel Corporation nor the names of its
16+
# contributors may be used to endorse or promote products derived
17+
# from this software without specific prior written permission.
18+
#
19+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
#
31+
32+
set -e
33+
docker build --target sample_deb --build-arg https_proxy=$https_proxy \
34+
--build-arg http_proxy=$http_proxy -t sgx_sample_deb -f ./Dockerfile ../../
35+
36+
# Another container should expose AESM and its socket in aesmd-socket volume.
37+
# Replace /dev/sgx_enclave with /dev/isgx if you use the Legacy Launch Control driver
38+
docker run --env http_proxy --env https_proxy --device=/dev/sgx_enclave -v aesmd-socket:/var/run/aesmd -it sgx_sample_deb

docker/build/build_and_run_sample_docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ docker build --target sample --build-arg https_proxy=$https_proxy \
3434
--build-arg http_proxy=$http_proxy -t sgx_sample -f ./Dockerfile ../../
3535

3636
# Another container should expose AESM and its socket in aesmd-socket volume.
37-
# Replace /dev/sgx/enclave with /dev/isgx if you use the Legacy Launch Control driver
38-
docker run --env http_proxy --env https_proxy --device=/dev/sgx/enclave -v aesmd-socket:/var/run/aesmd -it sgx_sample
37+
# Replace /dev/sgx_enclave with /dev/isgx if you use the Legacy Launch Control driver
38+
docker run --env http_proxy --env https_proxy --device=/dev/sgx_enclave -v aesmd-socket:/var/run/aesmd -it sgx_sample

linux/installer/common/psw/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ ECL_VER=1.0.0
4646
LCH_VER=1.0.0
4747
EPID_VER=1.0.0
4848
QEX_VER=1.0.0
49+
URTS_VER:= 2.0.0.0
50+
QE3L_VER:=1.0.0
4951

5052
default:
5153

@@ -63,6 +65,9 @@ install:
6365
mv $(PSW_LIB_PATH)/libsgx_enclave_common.so $(USR_LIB_PATH)
6466
rmdir $(PSW_LIB_PATH)
6567
cd $(USR_LIB_PATH) && \
68+
mv libsgx_urts.so libsgx_urts.so.$(URTS_VER) && \
69+
ln -fs libsgx_urts.so.$(URTS_VER) libsgx_urts.so.$(call SPLIT_VERSION,$(URTS_VER),1) && \
70+
ln -fs libsgx_urts.so.$(call SPLIT_VERSION,$(URTS_VER),1) libsgx_urts.so &&\
6671
mv libsgx_enclave_common.so libsgx_enclave_common.so.$(ECL_VER) && \
6772
ln -fs libsgx_enclave_common.so.$(ECL_VER) libsgx_enclave_common.so.$(call SPLIT_VERSION,$(ECL_VER),1) && \
6873
ln -fs libsgx_enclave_common.so.$(call SPLIT_VERSION,$(ECL_VER),1) libsgx_enclave_common.so && \
@@ -76,4 +81,5 @@ install:
7681
ln -fs libsgx_quote_ex.so.$(QEX_VER) libsgx_quote_ex.so.$(call SPLIT_VERSION,$(QEX_VER),1) && \
7782
ln -fs libsgx_quote_ex.so.$(call SPLIT_VERSION,$(QEX_VER),1) libsgx_quote_ex.so
7883
cd $(INSTALL_PATH)/aesm && \
79-
ln -fs liburts_internal.so libsgx_urts.so
84+
ln -fs liburts_internal.so libsgx_urts.so.$(call SPLIT_VERSION,$(URTS_VER),1) && \
85+
ln -fs libsgx_qe3_logic.so.$(call SPLIT_VERSION,$(QE3L_VER),1) libsgx_qe3_logic.so

0 commit comments

Comments
 (0)