Skip to content

Commit 3ab3a85

Browse files
committed
make the dockerfile stand-alone
1 parent ac6697b commit 3ab3a85

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

samples/docker_aks/Dockerfile

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
FROM ubuntu:20.04 as builder
2+
3+
RUN apt-get update && apt-get install -y wget gcc
4+
5+
# Using these as links so that this Dockerfile is stand-alone
6+
RUN wget https://raw.githubusercontent.com/deislabs/mystikos/main/samples/docker_aks/hello.c
7+
RUN wget https://raw.githubusercontent.com/deislabs/mystikos/main/samples/docker_aks/config.json
8+
9+
RUN gcc -fPIC -o hello hello.c
10+
111
FROM mystikos.azurecr.io/mystikos-focal:latest
212

3-
ADD appdir/bin/hello /appdir/bin/hello
4-
ADD config.json config.json
13+
COPY --from=builder /hello /appdir/bin/hello
14+
COPY --from=builder /config.json /config.json
515

616
RUN openssl genrsa -out private.pem -3 3072
717
RUN ./opt/mystikos/bin/myst package-sgx appdir private.pem config.json

samples/docker_aks/Makefile

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ APPDIR := appdir
55
BUILD_DIR := $(CURDIR)
66
CFLAGS := -fPIC
77
DOCKER_IMG := mystikos-hello
8-
MYST_TARBALL := mystikos.tar.gz
9-
PSW_VERSION := 2.15.100
10-
MYST_RELEASE_VERSION := 0.5.0
11-
PACKAGE := myst/bin/hello
8+
MYST_TARBALL := mystikos.tar.gz
9+
PACKAGE := myst/bin/hello
1210

1311
.PHONY: $(APPDIR) run clean
1412

@@ -18,7 +16,7 @@ $(APPDIR): hello.c
1816
@rm -rf $(APPDIR)
1917
@mkdir -p $(APPDIR)/bin
2018
@gcc $(CFLAGS) -o $(APPDIR)/bin/hello hello.c
21-
@docker build --build-arg PSW_VERSION=$(PSW_VERSION) --build-arg MYST_RELEASE_VERSION=$(MYST_RELEASE_VERSION) -t $(DOCKER_IMG) .
19+
@docker build -t $(DOCKER_IMG) .
2220

2321
# IMPORTANT:
2422
# Before running this option, please set the RESOURCE_GROUP and CLUSTER_NAME options

0 commit comments

Comments
 (0)