-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
63 lines (50 loc) · 1.78 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#########
# Stage 1 - fetch build tools, fetch Tuplex source, and build it
FROM ubuntu:20.04 as builder
LABEL maintainer "Maintainer <[email protected]>"
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
# Copy the Tuplex source from the host context
COPY compiler /usr/local/tuplex/compiler
# 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 small release image with build results
FROM ubuntu:20.04
LABEL maintainer "Maintainer <[email protected]>"
LABEL description="This is a Ubuntu Docker image for running the Tuplex compiler"
# Install minimal software to run the Tuplex test suite, and the nano editor
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/