-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_no_git
66 lines (53 loc) · 1.96 KB
/
Dockerfile_no_git
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
61
62
63
64
65
66
#########
# Stage 1 - fetch build tools, fetch Tuplex source, and build it
FROM ubuntu:20.04 as builder
LABEL maintainer "Maintainer <tuplex@chervil.se>"
LABEL description="This is a Ubuntu Docker image for building the Tuplex compiler"
# Install general build tools
# Install software to fetch the Tuplex source, and needed LLVM components
RUN apt-get update && apt-get install -y \
bison \
cmake \
make \
gcc \
g++ \
curl \
ca-certificates \
unzip \
libllvm11 \
llvm-11-dev \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Add LLVM to path
ENV PATH $PATH:/usr/lib/llvm-11/bin
# Fetch the Tuplex source
RUN curl -sSL https://github.com/TuplexLanguage/tuplex/archive/master.zip --output /usr/local/master.zip && \
unzip -q /usr/local/master.zip -d /usr/local && \
ln -s /usr/local/tuplex-master /usr/local/tuplex && \
rm /usr/master.zip
# Build tuplex
# Create a Tuplex release bundle (without sources and build files)
RUN mkdir /usr/local/tuplex/compiler/build-release && \
cd /usr/local/tuplex/compiler/build-release && \
cmake .. && \
make -j7 && \
../scripts/copytxrelease -nozip
#########
# Stage 2 - produce a minimal release image with build results
FROM ubuntu:20.04
LABEL maintainer "Maintainer <tuplex@chervil.se>"
LABEL description="This is a Ubuntu Docker image for running the Tuplex compiler"
# Install software to fetch the Tuplex source, and needed LLVM components
RUN apt-get update && apt-get install -y \
python3-minimal \
libllvm11 \
nano-tiny \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/tuplex/compiler/build-release/releases/latest /usr/local/tuplex/compiler
# Add Tuplex bin and scripts to path
ENV PATH /usr/local/tuplex/compiler/scripts:/usr/local/tuplex/compiler/bin:$PATH
# Set Tuplex' source path var
ENV TUPLEX_HOME /usr/local/tuplex/compiler
ENV TUPLEX_MODULE_PATHS .
WORKDIR /usr/local/tuplex/compiler