You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by sh...@apache.org on 2022/11/11 05:17:55 UTC

[incubator-teaclave-java-tee-sdk] 15/48: [ENC] Prepare docker for musl static lib

This is an automated email from the ASF dual-hosted git repository.

shaojunwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-java-tee-sdk.git

commit f4aa24162a7839d984ff2a28308df59762927cca
Author: Ziyi Lin <ce...@alibaba-inc.com>
AuthorDate: Wed May 18 19:50:00 2022 +0800

    [ENC] Prepare docker for musl static lib
    
    Summary: Prepare tool chains in docker for compiling musl based static
    library.
    
    Test Plan: all tests pass
    
    Reviewers: lei.yul, jeffery.wsj, sanhong.lsh
    
    Issue: https://aone.alibaba-inc.com/task/41619151
    
    CR:
    https://code.aone.alibaba-inc.com/java-tee/JavaEnclave/codereview/8751549
---
 tools/cicd/Dockerfile | 18 ++++++++++++------
 tools/cicd/make.sh    |  4 ++++
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/tools/cicd/Dockerfile b/tools/cicd/Dockerfile
index f988bd3..94d2af4 100644
--- a/tools/cicd/Dockerfile
+++ b/tools/cicd/Dockerfile
@@ -1,15 +1,21 @@
-FROM ubuntu:18.04 AS base
+FROM ubuntu:18.04
 
 LABEL maintainer="Junshao Wang <je...@alibaba-inc.com>"
 
 ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
 ENV DEBIAN_FRONTEND noninteractive
 
-# install openjdk11 and maven.
-RUN apt-get update && \
-    echo -e 'yes\n' | apt-get install -y maven && \
-    echo -e 'yes\n' | apt-get install -y build-essential libz-dev zlib1g-dev && \
-    echo -e 'yes\n' | apt-get install -y wget
 ADD ["graalvm-enclave-22.0.0.tar", "/root/tools/"]
+ADD ["x86_64-linux-musl-native.tgz", "/root/tools/"]
+ADD ["zlib-1.2.12.tar.gz", "/root/tools/"]
 ENV GRAALVM_HOME "/root/tools/graalvm-enclave-22.0.0"
 ENV JAVA_HOME "/root/tools/graalvm-enclave-22.0.0"
+ENV CC "/root/tools/x86_64-linux-musl-native/bin/gcc"
+ENV PATH $PATH:"/root/tools/x86_64-linux-musl-native/bin"
+
+# install necessary tools.
+RUN apt-get update && \
+    echo -e 'yes\n' | apt-get install -y maven && \
+    echo -e 'yes\n' | apt-get install -y build-essential libz-dev zlib1g-dev && \
+    echo -e 'yes\n' | apt-get install -y wget && \
+    cd /root/tools/zlib-1.2.12 && ./configure --prefix=/root/tools/x86_64-linux-musl-native --static && make && make install
diff --git a/tools/cicd/make.sh b/tools/cicd/make.sh
index 04657d5..50f9d2f 100755
--- a/tools/cicd/make.sh
+++ b/tools/cicd/make.sh
@@ -14,8 +14,12 @@ if [[ "$(docker images -q ${BUILD_IMAGE}:${BUILD_TAG} 2> /dev/null)" == "" ]]; t
   # Get the customized Graal VM from git@gitlab.alibaba-inc.com:graal/SGXGraalVM.git
   # This should be replaced to the offical version when all patches are accepted by the Graal community
   wget https://graal.oss-cn-beijing.aliyuncs.com/graal-enclave/JDK11-22.0.0/graalvm-enclave-22.0.0.tar
+  wget http://graal.oss-cn-beijing.aliyuncs.com/graal-enclave/x86_64-linux-musl-native.tgz
+  wget http://graal.oss-cn-beijing.aliyuncs.com/graal-enclave/zlib-1.2.12.tar.gz
   docker build -t ${BUILD_IMAGE}:${BUILD_TAG} .
   rm -f graalvm-enclave-22.0.0.tar
+  rm -f x86_64-linux-musl-native.tgz
+  rm -f zlib-1.2.12.tar.gz
 fi
 
 # test JavaEnclave's unit test cases and samples


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org