-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (37 loc) · 1.35 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
# --------------------------------------------------------------------------------------------------
# Docker container with the compiler, runtime and examples.
# --------------------------------------------------------------------------------------------------
# -- Build container.
FROM alpine:latest as build
LABEL description="Novus - build container"
# Update the package manager.
RUN apk update
# Install build deps: gcc, make, cmake, libc-dev, bash, git and other basic build dependencies.
RUN apk add --no-cache build-base cmake bash git
# Copy sources into the build container.
COPY apps /novus/apps
COPY include /novus/include
COPY std /novus/std
COPY scripts /novus/scripts
COPY src /novus/src
COPY utilities /novus/utilities
COPY CMakeLists.txt /novus/CMakeLists.txt
WORKDIR /novus
# Configure.
RUN bash ./scripts/configure.sh
# Build.
RUN bash ./scripts/build.sh
# -- Run container.
FROM alpine:latest as runtime
LABEL description="Novus - run container"
# Update package manager.
RUN apk update
# Install libstdc++ runtime library.
RUN apk add --no-cache libstdc++
# Copy the binaries from the build container.
RUN mkdir /novus
COPY --from=build /novus/bin/. /novus
# Add the novus directory to the path.
ENV PATH="/novus:${PATH}"
# Copy the examples into the run container.
COPY examples /examples