-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (58 loc) · 2.58 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
# EPICS Dockerfile for Asyn and other fundamental support modules
##### build stage ##############################################################
FROM ghcr.io/epics-containers/epics-base:7.0.6.1r1.0 AS developer
# install additional packages
USER root
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
libc-dev-bin \
libusb-1.0-0-dev \
python3-pip \
python3.8-minimal \
re2c \
wget \
&& rm -rf /var/lib/apt/lists/*
# import support folder root files
COPY --chown=${USER_UID}:${USER_GID} ./support/. ${SUPPORT}/
RUN chown ${USERNAME} ${SUPPORT}
WORKDIR ${SUPPORT}
# setup module.py for managing support module dependencies
RUN pip install -r requirements.txt
USER ${USERNAME}
# initialize the global support/configure/RELEASE
RUN python3 module.py init
# get basic support modules in order of dependencies
RUN python3 module.py add-tar http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-{TAG}.tar.gz seq SNCSEQ 2.2.8 && \
python3 module.py add epics-modules sscan SSCAN R2-11-5 && \
python3 module.py add epics-modules calc CALC R3-7-4 && \
python3 module.py add epics-modules asyn ASYN R4-41 && \
python3 module.py add epics-modules alive ALIVE R1-3-1 && \
python3 module.py add epics-modules autosave AUTOSAVE R5-10-2 && \
python3 module.py add epics-modules busy BUSY R1-7-3 && \
python3 module.py add epics-modules iocStats DEVIOCSTATS 3.1.16 && \
python3 module.py add epics-modules std STD R3-6-2 && \
python3 module.py add paulscherrerinstitute StreamDevice STREAM 2.8.16
# patch support modules and fix up all dependencies
RUN echo IOC=${IOC} >> configure/RELEASE && \
./patch_modules.sh && \
python3 module.py dependencies
# add the generic IOC source code
COPY --chown=${USER_UID}:${USER_GID} ioc ${IOC}
# compile the support modules and the IOC
RUN cat ${SUPPORT}/seq-2-2-8/configure/RELEASE && \
make && \
make -j clean
##### runtime stage ############################################################
FROM ghcr.io/epics-containers/epics-base:7.0.6.1r1.0.run AS runtime
# install runtime libraries from additional packages section above
# also add busybox to aid debugging the runtime image
USER root
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
busybox-static \
libusb-1.0-0 \
&& rm -rf /var/lib/apt/lists/*
USER ${USERNAME}
# get the products from the build stage
COPY --from=developer --chown=${USER_UID}:${USER_GID} ${SUPPORT} ${SUPPORT}
COPY --from=developer --chown=${USER_UID}:${USER_GID} ${IOC} ${IOC}