Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the dockerfile stand-alone & update container call #1507

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions samples/docker_aks/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
FROM ubuntu:20.04 as builder

RUN apt-get update && apt-get install -y wget gcc
salsal97 marked this conversation as resolved.
Show resolved Hide resolved

# Using these as links so that this Dockerfile is stand-alone
RUN wget https://github.com/raw/deislabs/mystikos/main/samples/docker_aks/hello.c
RUN wget https://github.com/raw/deislabs/mystikos/main/samples/docker_aks/config.json
salsal97 marked this conversation as resolved.
Show resolved Hide resolved

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
Expand Down
8 changes: 3 additions & 5 deletions samples/docker_aks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
salsal97 marked this conversation as resolved.
Show resolved Hide resolved
MYST_RELEASE_VERSION := 0.5.0
PACKAGE := myst/bin/hello
MYST_TARBALL := mystikos.tar.gz
PACKAGE := myst/bin/hello
salsal97 marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: $(APPDIR) run clean

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion samples/docker_aks/myst-helloworld.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down