-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (30 loc) · 1022 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM docker.io/library/golang:1.18 as builder
WORKDIR /
COPY julia_download.sh ./
RUN ./julia_download.sh
WORKDIR /gocode/julia
COPY go.mod ./
COPY *.go ./
WORKDIR /gocode/julia
COPY examples ./examples/
WORKDIR /gocode/julia/examples/matrix-inversion
RUN go mod tidy
RUN go build -o matrix-inversion ./
WORKDIR /gocode/julia/examples/matrix-multiplication
RUN go mod tidy
RUN go build -o matrix-multiplication ./
WORKDIR /gocode/julia/examples/json-serialization
RUN go mod tidy
RUN go build -o json-serialization ./
FROM docker.io/library/ubuntu:20.04 as base
RUN apt-get update && apt-get install wget -y
WORKDIR /
COPY julia_download.sh ./
RUN ./julia_download.sh
# run julia code to install packages
COPY init.jl ./
RUN julia ./init.jl
WORKDIR /go-julia
COPY --from=builder /gocode/julia/examples/matrix-inversion/matrix-inversion ./
COPY --from=builder /gocode/julia/examples/matrix-multiplication/matrix-multiplication ./
COPY --from=builder /gocode/julia/examples/json-serialization/json-serialization ./