forked from stillwater-sc/universal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (66 loc) · 5.93 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# multi-stage build
# docker build --target builder -t stillwater/universal:builder will just build a builder container
# docker build --target release -t stillwater/universal:release will just build a release container
# BUILDER stage
FROM gcc:7 as builder
MAINTAINER Theodore Omtzigt
# create a cmake build environment
RUN apt-get update && apt-get install -y build-essential apt-utils cmake \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# make certain you have a good .dockerignore file installed so that this layer isn't ginormous
COPY . /usr/src/universal
# print contextual information of the container at this state for validation the process is solid
RUN ls -la /usr/src/universal && cmake -version
# set up the cmake/make environment to issue the build commands
RUN mkdir build
WORKDIR /usr/src/universal/build
RUN cmake -DBUILD_CI_CHECK=ON .. && make
# actual command 'make test' is run as part of the test pipeline
# add a command that when you run the container without a command, it produces something meaningful
CMD ["echo", "Universal Numbers Library Version 2.0.0"]
# RELEASE stage
#FROM alpine:latest as release # hitting a segfault during startup of some playground programs
FROM debian:latest as release
MAINTAINER Theodore Omtzigt
#RUN apk add --no-cache libc6-compat libstdc++ make cmake bash gawk sed grep bc coreutils
RUN apt-get update && apt-get install -y make cmake
# after building, the test executables are organized in the build directory under root
# ctest gets its configuration for CTestTestfile.cmake files. There is one at the root of the build tree
# and one for each directory that contains test executables.
COPY --from=builder /usr/src/universal/build/tools/cmd/cmd_* /usr/src/universal/build/tools/cmd/
COPY --from=builder /usr/src/universal/build/tools/cmd/*.cmake /usr/src/universal/build/tools/cmd/
COPY --from=builder /usr/src/universal/build/tests/posit/posit_* /usr/src/universal/build/tests/posit/
COPY --from=builder /usr/src/universal/build/tests/posit/*.cmake /usr/src/universal/build/tests/posit/
COPY --from=builder /usr/src/universal/build/perf/perf_* /usr/src/universal/build/perf/
COPY --from=builder /usr/src/universal/build/perf/*.cmake /usr/src/universal/build/perf/
COPY --from=builder /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_exact_test /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_exact_test
COPY --from=builder /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_experiment /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_experiment
COPY --from=builder /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit4 /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit4
COPY --from=builder /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit8 /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit8
COPY --from=builder /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit16 /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit16
COPY --from=builder /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit32 /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit32
COPY --from=builder /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit64 /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit64
COPY --from=builder /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit128 /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit128
COPY --from=builder /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit256 /usr/src/universal/build/c_api/shim/test/posit/c_api_shim_posit256
COPY --from=builder /usr/src/universal/build/c_api/shim/test/posit/*.cmake /usr/src/universal/build/c_api/shim/test/posit/
COPY --from=builder /usr/src/universal/build/c_api/pure_c/test/posit/c_api_pure_posit8 /usr/src/universal/build/c_api/pure_c/test/posit/c_api_pure_posit8
COPY --from=builder /usr/src/universal/build/c_api/pure_c/test/posit/c_api_pure_playground /usr/src/universal/build/c_api/pure_c/test/posit/c_api_pure_playground
COPY --from=builder /usr/src/universal/build/c_api/pure_c/test/posit/*.cmake /usr/src/universal/build/c_api/pure_c/test/posit/
COPY --from=builder /usr/src/universal/build/examples/blas/blas_* /usr/src/universal/build/examples/blas/
COPY --from=builder /usr/src/universal/build/examples/blas/*.cmake /usr/src/universal/build/examples/blas/
COPY --from=builder /usr/src/universal/build/examples/dsp/dsp_* /usr/src/universal/build/examples/dsp/
COPY --from=builder /usr/src/universal/build/examples/dsp/*.cmake /usr/src/universal/build/examples/dsp/
COPY --from=builder /usr/src/universal/build/education/posit/edu_* /usr/src/universal/build/education/posit/
COPY --from=builder /usr/src/universal/build/education/posit/*.cmake /usr/src/universal/build/education/posit/
COPY --from=builder /usr/src/universal/build/examples/playground/playgr* /usr/src/universal/build/examples/playground/
COPY --from=builder /usr/src/universal/build/examples/playground/*.cmake /usr/src/universal/build/examples/playground/
# the ctest configuration root and Makefile so we can execute _make test_ in the test stage of the CI/CD pipeline
COPY --from=builder /usr/src/universal/build/Makefile /usr/src/universal/build/
COPY --from=builder /usr/src/universal/build/CTestTestfile.cmake /usr/src/universal/build/
WORKDIR /usr/src/universal/build
# double check we have all the executables of interest
RUN find .
#CMD ["/usr/src/universal/tools/cmd/cmd_numeric_limits"]
CMD ["echo", "Universal Numbers Library Version 2.0.0"]