diff --git a/samples/docker_aks/Dockerfile b/samples/docker_aks/Dockerfile index 50016e2eb..0062acdb6 100644 --- a/samples/docker_aks/Dockerfile +++ b/samples/docker_aks/Dockerfile @@ -1,7 +1,17 @@ +FROM ubuntu:20.04 as builder + +RUN apt-get update && apt-get install -y wget gcc + +# Using these as links so that this Dockerfile is stand-alone +RUN wget https://raw.githubusercontent.com/deislabs/mystikos/main/samples/docker_aks/hello.c +RUN wget https://raw.githubusercontent.com/deislabs/mystikos/main/samples/docker_aks/config.json + +RUN gcc -fPIC -o hello hello.c + FROM mystikos.azurecr.io/mystikos-focal:latest -ADD appdir/bin/hello /appdir/bin/hello -ADD config.json config.json +COPY --from=builder /hello /appdir/bin/hello +COPY --from=builder /config.json /config.json RUN openssl genrsa -out private.pem -3 3072 RUN ./opt/mystikos/bin/myst package-sgx appdir private.pem config.json diff --git a/samples/docker_aks/Makefile b/samples/docker_aks/Makefile index 3ecf666a7..d4a2c306a 100644 --- a/samples/docker_aks/Makefile +++ b/samples/docker_aks/Makefile @@ -5,10 +5,8 @@ APPDIR := appdir BUILD_DIR := $(CURDIR) CFLAGS := -fPIC DOCKER_IMG := mystikos-hello -MYST_TARBALL := mystikos.tar.gz -PSW_VERSION := 2.15.100 -MYST_RELEASE_VERSION := 0.5.0 -PACKAGE := myst/bin/hello +MYST_TARBALL := mystikos.tar.gz +PACKAGE := myst/bin/hello .PHONY: $(APPDIR) run clean @@ -18,7 +16,7 @@ $(APPDIR): hello.c @rm -rf $(APPDIR) @mkdir -p $(APPDIR)/bin @gcc $(CFLAGS) -o $(APPDIR)/bin/hello hello.c - @docker build --build-arg PSW_VERSION=$(PSW_VERSION) --build-arg MYST_RELEASE_VERSION=$(MYST_RELEASE_VERSION) -t $(DOCKER_IMG) . + @docker build -t $(DOCKER_IMG) . # IMPORTANT: # Before running this option, please set the RESOURCE_GROUP and CLUSTER_NAME options diff --git a/samples/docker_aks/myst-helloworld.yaml b/samples/docker_aks/myst-helloworld.yaml index f65676f23..aa444750a 100644 --- a/samples/docker_aks/myst-helloworld.yaml +++ b/samples/docker_aks/myst-helloworld.yaml @@ -10,7 +10,7 @@ spec: spec: containers: - name: myst-helloworld - image: mystikos/myst-helloworld:0.2 + image: mcr.microsoft.com/acc/samples/myst-helloworld:0.3 volumeMounts: - name: var-run-aesmd mountPath: /var/run/aesmd