-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 1.27 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
FROM ubuntu:22.04 AS skiplang-base
ARG TARGETARCH
ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=type=bind,source=./bin/apt-install.sh,target=/tmp/apt-install.sh \
--mount=type=cache,id=apt-cache-$TARGETARCH,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lists-$TARGETARCH,target=/var/lib/apt/lists,sharing=locked \
/tmp/apt-install.sh skiplang-build-deps
ENV CC=clang
ENV CXX=clang++
FROM skiplang-base AS bootstrap
ARG STAGE=0
COPY ./skiplang /work
WORKDIR /work/compiler
RUN make clean && make STAGE=$STAGE
FROM skiplang-base AS skiplang
ARG STAGE=0
COPY --link --from=bootstrap /work/compiler/stage${STAGE}/bin/ /usr/bin/
COPY --link --from=bootstrap /work/compiler/stage${STAGE}/lib/ /usr/lib/
FROM skiplang AS skip
RUN --mount=type=bind,source=./bin/apt-install.sh,target=/tmp/apt-install.sh \
--mount=type=bind,source=./requirements-dev.txt,target=/tmp/requirements-dev.txt \
--mount=type=cache,id=apt-cache-$TARGETARCH,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lists-$TARGETARCH,target=/var/lib/apt/lists,sharing=locked \
--mount=type=cache,target=/root/.npm,sharing=locked \
--mount=type=cache,target=/root/.cache/pip,sharing=locked \
/tmp/apt-install.sh skipruntime-deps other-CI-tools other-dev-tools