Skip to content

Instantly share code, notes, and snippets.

@blackrez
Last active April 11, 2019 09:41
Show Gist options
  • Save blackrez/03596164a0f2df91324f06bc21256068 to your computer and use it in GitHub Desktop.
Save blackrez/03596164a0f2df91324f06bc21256068 to your computer and use it in GitHub Desktop.
FROM golang:alpine AS build-env
RUN mkdir -p /src/src/github.com/owulveryck/ && \
cd /src/src/github.com/owulveryck/ && \
apk add - no-cache git curl && \
git clone https://github.com/owulveryck/onnx-go.git && \
cd onnx-go && \
git checkout v0.1-mnist-cli && \
cd example/gorgonia/mnist-reader && \
export GOPATH=$GOPATH:/src/ && \
go get && \
go build -o /src/mnist-app
FROM alpine
WORKDIR /app
COPY - from=build-env /src/mnist-app /app/
RUN apk add - no-cache curl ca-certificates && \
mkdir /data && \
curl https://www.cntk.ai/OnnxModels/mnist/opset_7/mnist.tar.gz | tar -C /data -xzf - && \
apk del curl
CMD ["./mnist-app", "-model", "/data/mnist/model.onnx", "-p", "8080"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment