-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
90 lines (62 loc) · 2.67 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
78
79
80
81
82
83
84
85
86
87
88
ARG IMAGE_EXT
ARG BASE=7.0.8ec2
ARG REGISTRY=ghcr.io/epics-containers
ARG RUNTIME=${REGISTRY}/epics-base${IMAGE_EXT}-runtime:${BASE}
ARG DEVELOPER=${REGISTRY}/epics-base${IMAGE_EXT}-developer:${BASE}
##### build stage ##############################################################
FROM ${DEVELOPER} AS developer
# Add missing dependancies
RUN curl -o /usr/bin/yq -L https://github.com/mikefarah/yq/releases/download/v4.44.2/yq_linux_amd64 && chmod +x /usr/bin/yq
# The devcontainer mounts the project root to /epics/generic-source
# Using the same location here makes devcontainer/runtime differences transparent.
ENV SOURCE_FOLDER=/epics/generic-source
# connect ioc source folder to its know location
RUN ln -s ${SOURCE_FOLDER}/ioc ${IOC}
# Get the current version of ibek
COPY requirements.txt requirements.txt
RUN pip install --upgrade -r requirements.txt
WORKDIR ${SOURCE_FOLDER}/ibek-support
# copy the global ibek files
COPY ibek-support/_global/ _global
COPY ibek-support/pvxs/ pvxs/
RUN pvxs/install.sh 1.3.1
COPY ibek-support/iocStats/ iocStats
RUN iocStats/install.sh 3.2.0
COPY ibek-support/asyn/ asyn/
RUN asyn/install.sh R4-42
COPY ibek-support/autosave/ autosave/
RUN autosave/install.sh R5-11
COPY ibek-support/busy/ busy/
RUN busy/install.sh R1-7-3
COPY ibek-support/sscan/ sscan/
RUN sscan/install.sh R2-11-6
COPY ibek-support/calc/ calc/
RUN calc/install.sh R3-7-5
COPY ibek-support/ADCore/ ADCore/
RUN ADCore/install.sh R3-12-1
COPY ibek-support/ADGenICam/ ADGenICam/
RUN ADGenICam/install.sh R1-9
COPY ibek-support/ADAravis/ ADAravis/
RUN ADAravis/install.sh R2-3
# get the ioc source and build it
COPY ioc ${SOURCE_FOLDER}/ioc
RUN cd ${IOC} && ./install.sh && make
# install runtime proxy for non-native builds
RUN bash ${IOC}/install_proxy.sh
# make sure that start.sh can write its generated files
RUN chmod a+rw /epics/*
##### runtime preparation stage ################################################
FROM developer AS runtime_prep
# get the products from the build stage and reduce to runtime assets only
RUN ibek ioc extract-runtime-assets /assets /usr/local/lib/x86_64-linux-gnu
##### runtime stage ############################################################
FROM ${RUNTIME} AS runtime
# get runtime assets from the preparation stage
COPY --from=runtime_prep /assets /
COPY --from=runtime_prep /usr/bin/yq /usr/bin/yq
# install runtime system dependencies, collected from install.sh scripts
RUN ibek support apt-install-runtime-packages --skip-non-native
# allow generated genicam files to be written for non root runtime user id
RUN chmod a+rw -R /epics/pvi-defs /epics/support/ADGenICam/db \
/epics/generic-source/ibek-support
CMD ["bash", "-c", "${IOC}/start.sh"]