-
-
Notifications
You must be signed in to change notification settings - Fork 114
/
Dockerfile
33 lines (24 loc) · 1007 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
# This Dockerfile constructs an environment in which the Grain compiler can be built and used.
FROM ospencer/esy:alpine as esy
FROM node:18
LABEL name="Grain"
LABEL description="Grain CLI"
LABEL vcs-url="https://github.com/grain-lang/grain"
LABEL maintainer="team@grain-lang.org"
COPY . /grain
WORKDIR /grain
# esy does not currently ship linux/arm64 binaries, so we manually patch it in
# Install dependencies but don't allow esy's postinstall script to run
RUN npm ci --ignore-scripts
# This line is technically incorrect on amd64, but docker does not support
# conditional copies and the arm64 folder is ignored on amd64 anyway
COPY --from=esy /app/_release /grain/node_modules/esy/platform-linux-arm64
# Manually run esy's postinstall script
RUN cd node_modules/esy && npm run postinstall
# Necessary because we disabled scripts during the original install
RUN npm run prepare
# Build the compiler and CLI
RUN npm run compiler build
# Set up container environment
WORKDIR /
CMD [ "/bin/bash" ]