-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (39 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
60 lines (39 loc) · 1.3 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# start from node image so we can install esy from npm
FROM node:10.13-alpine as build
ENV TERM=dumb LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib
RUN mkdir /esy
WORKDIR /esy
ENV NPM_CONFIG_PREFIX=/esy
RUN npm install -g --unsafe-perm esy@0.5.6
# now that we have esy installed we need a proper runtime
FROM alpine:3.8 as esy
ENV TERM=dumb LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib
WORKDIR /
COPY --from=build /esy /esy
RUN apk add --no-cache ca-certificates wget bash curl perl-utils git patch gcc g++ musl-dev make m4 gmp-dev linux-headers
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk
RUN apk add --no-cache glibc-2.28-r0.apk
ENV PATH=/esy/bin:$PATH
RUN mkdir /app
WORKDIR /app
RUN echo ' \
{\
"name": "package-base", \
"dependencies": { \
"ocaml": "~4.7.1000", \
"@opam/dune": "*", \
"@opam/reason": "*", \
"@esy-packages/esy-openssl": "esy-packages/esy-openssl#65efbc9" \
} \
} \
' > esy.json
RUN esy
COPY esy.json esy.json
COPY esy.lock esy.lock
RUN esy fetch
RUN esy true
COPY . .
RUN esy b dune build src/hello_world.exe --profile=static
RUN esy mv '#{self.target_dir}/default/src/hello_world.exe' bootstrap
RUN strip bootstrap