|
@@ -36,7 +36,7 @@ RUN git clone https://git-crysp.uwaterloo.ca/miti/verifier.git && \
|
|
|
cd verifier/ && git checkout recreating_state_for_teeter && \
|
|
|
export SGX_SDK_TRTS_MODIFIED=/root/source/linux-sgx-trts-modified/build/linux && make && \
|
|
|
cp verifier /root/graphene/LibOS/shim/test/native && \
|
|
|
- git checkout master && \
|
|
|
+ git checkout master && git log && \
|
|
|
cp verifier.manifest.template /root/graphene/LibOS/shim/test/native
|
|
|
|
|
|
#Build the verifier
|
|
@@ -51,40 +51,45 @@ RUN git clone --recursive https://github.com/CopernicaMarketingSoftware/PHP-CPP.
|
|
|
cd PHP-CPP/ && git checkout tags/v2.1.4 && make all && \
|
|
|
cp libphpcpp.so.* /usr/lib/ && make install
|
|
|
|
|
|
+#Dependencies for Apache
|
|
|
+RUN apt update && apt install -y build-essential flex libapr1-dev libaprutil1-dev libpcre2-dev apache2-utils libssl-dev
|
|
|
RUN git clone https://git-crysp.uwaterloo.ca/miti/Apache_PHP_extension.git && \
|
|
|
- cd Apache_PHP_extension && git checkout recreating_state_for_teeter && \
|
|
|
+ cd Apache_PHP_extension && git checkout recreating_state_for_teeter && \
|
|
|
make
|
|
|
|
|
|
WORKDIR /root/graphene/LibOS/shim/test/apps/apache
|
|
|
#Modifying the Makefile to generate the php module.
|
|
|
RUN sed -i s/'LISTEN_HOST ?= 127.0.0.1'/'LISTEN_HOST ?= 0.0.0.0'/g Makefile
|
|
|
-RUN sed -i s/'testdata ssldata'/'$(INSTALL_DIR)/modules/libphp7.so #testdata ssldata'/g Makefile
|
|
|
+RUN sed -i 's:testdata ssldata:ssldata $(INSTALL_DIR)/modules/libphp7.so:' Makefile
|
|
|
RUN sed -i s/"'-'"/"'-' | tr '+' 'p'"/g Makefile #Fix for stdc++ to be named as a key sgx.trusted_files.stdcpp in the autogenerated manifest.
|
|
|
-RUN printf '\nPHP_DIR = php-7.0.7 \n$(PHP_DIR): $(PHP_DIR).tar.gz\n\ttar -xmzf $<\n' >> Makefile
|
|
|
-RUN printf '\n$(INSTALL_DIR)/modules/libphp7.so: $(PHP_DIR) $(INSTALL_DIR)/bin/apxs\n' >> Makefile
|
|
|
-RUN printf '\tcd $< && ./configure --prefix=$(abspath $(INSTALL_DIR)) --with-apxs2=$(abspath $(INSTALL_DIR)/bin/apxs) \ \n' >> Makefile
|
|
|
-RUN printf '\t--disable-cgi --disable-cli --disable-soap\n\tcd $< && $(MAKE) \n\tcd $< && $(MAKE) install\n' >> Makefile
|
|
|
-RUN printf '\nbuild-apache-with-php: $(INSTALL_DIR)/bin/httpd $(INSTALL_DIR)/modules/libphp7.so\n' >> Makefile
|
|
|
+#Copy the PHP 7 archive (PHPCPP requires at least version 7)
|
|
|
RUN cp /root/source/Apache_PHP_extension/*.tar.gz ./
|
|
|
-#Don't make the manifest yet - make the apache/php build first and then the manifest.
|
|
|
+#Copy targets for generating the php module library from the archive to the makefile.
|
|
|
+RUN cat /root/source/Apache_PHP_extension/apacheMakefile >> Makefile
|
|
|
+#Install dependencies for Apache
|
|
|
+RUN apt update && apt install -y build-essential flex libapr1-dev libaprutil1-dev libpcre2-dev apache2-utils libssl-dev
|
|
|
+#Make the apache/php build first
|
|
|
+#In the new graphene version, runtime tokens are also generated along with the manifests, and these tokens require the AESMD service.
|
|
|
+#We start the aesmd service at runtime and generate all targets by running 'make SGX=1' on this folder at runtime.
|
|
|
RUN make SGX=1 build-apache-with-php
|
|
|
|
|
|
#Add the updated httpd.manifest.template #Todo update manifest.
|
|
|
RUN cp /root/source/Apache_PHP_extension/httpd.manifest.template ./
|
|
|
-#Add the extension to the obj/modules folder.
|
|
|
+#Add the extension to the modules folder.
|
|
|
RUN cp /root/source/Apache_PHP_extension/localattestation_decryption.so install/modules/
|
|
|
#Add the PHP .ini file from the PHP folder to the location accessed by the PHP setup at runtime
|
|
|
RUN cp ./php-7.0.7/php.ini-development install/lib/php.ini
|
|
|
-#Add the extension directory and the extension name to the php.ini
|
|
|
+#Add the extension path and the extension name to the php.ini
|
|
|
RUN echo "extension_dir=/root/graphene/LibOS/shim/test/apps/apache/install/modules" >> install/lib/php.ini && \
|
|
|
echo "extension=localattestation_decryption.so" >> install/lib/php.ini
|
|
|
#Add all php source code files to the right place.
|
|
|
RUN cp /root/source/Apache_PHP_extension/*.php install/htdocs
|
|
|
#Fix the configuration file for Apache
|
|
|
-RUN printf '\nAcceptFilter http none\n<IfModule mime_module>\n AddType application/x-httpd-php .php\n</IfModule>\n' > install/conf/httpd.conf
|
|
|
-RUN make SGX=1
|
|
|
+RUN printf '\nAcceptFilter http none\n<IfModule mime_module>\n AddType application/x-httpd-php .php\n</IfModule>\n' >> install/conf/httpd.conf
|
|
|
|
|
|
-WORKDIR /root
|
|
|
+WORKDIR /root
|
|
|
COPY deploy_enclaves.sh ./
|
|
|
RUN chmod 755 ./deploy_enclaves.sh
|
|
|
+COPY find_docker_ip.sh ./
|
|
|
+RUN chmod 755 ./find_docker_ip.sh
|
|
|
|