-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
38 lines (29 loc) · 1.26 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
FROM ubuntu:focal as base
ENV CCACHE_DIR=/ccache
USER root
#install runtime dependencies
COPY scripts /tmp/sc-machine/scripts
COPY scripts/set_vars.sh /tmp/sc-machine/scripts/set_vars.sh
COPY requirements.txt /tmp/sc-machine/requirements.txt
# tini is an init system to forward interrupt signals properly
RUN apt update && apt install -y --no-install-recommends sudo tini && /tmp/sc-machine/scripts/install_deps_ubuntu.sh
#build using ccache
FROM base as devdeps
RUN /tmp/sc-machine/scripts/install_deps_ubuntu.sh --dev
FROM devdeps as devcontainer
RUN apt install -y --no-install-recommends git cppcheck valgrind gdb bash-completion ninja-build curl
ENTRYPOINT ["/bin/bash"]
FROM devdeps as builder
WORKDIR /sc-machine
COPY . .
RUN --mount=type=cache,target=/ccache/ ./scripts/build_sc_machine.sh -r
#Gathering all artifacts together
FROM base AS final
COPY --from=builder /sc-machine/requirements.txt /sc-machine/requirements.txt
COPY --from=builder /sc-machine/scripts /sc-machine/scripts
COPY --from=builder /sc-machine/sc-machine.ini /sc-machine/sc-machine.ini
COPY --from=builder /sc-machine/bin /sc-machine/bin
RUN /sc-machine/scripts/install_deps_python.sh
WORKDIR /sc-machine/scripts
EXPOSE 8090
ENTRYPOINT ["/usr/bin/tini", "--", "/sc-machine/scripts/docker_entrypoint.sh"]