-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (38 loc) · 1.4 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
FROM centos:7.8.2003 AS builder
ENV WORK_DIR=/usr/local/epics
ENV EPICS_VER=3.15.8 \
USER=epics \
EPICS_BASE=$WORK_DIR/base \
EPICS_HOST_ARCH=linux-x86_64 \
PATH=$PATH:$WORK_DIR/base/bin/linux-x86_64
RUN yum install -y wget gcc-c++ readline-devel perl-devel make \
&& wget --no-check-certificate https://www.aps.anl.gov/epics/download/base/base-$EPICS_VER.tar.gz \
&& tar -zxvf base-$EPICS_VER.tar.gz \
&& mkdir $WORK_DIR \
&& mv base-$EPICS_VER $WORK_DIR \
&& rm base-$EPICS_VER.tar.gz \
&& cd $WORK_DIR \
&& ln -s base-$EPICS_VER base \
&& cd $WORK_DIR/base \
&& make \
&& yum remove -y wget gcc-c++ readline-devel perl-devel make \
&& rm -rf $WORK_DIR/base/src
# Slim image (~400MB -> ~20MB) by using busybox
RUN mkdir /deps \
&& cp --parents /lib64/libstdc++.so.6 /deps \
&& cp --parents /lib64/libm.so.6 /deps \
&& cp --parents /lib64/libgcc_s.so.1 /deps \
&& cp --parents /lib64/libreadline.so.6 /deps \
&& cp --parents /lib64/librt.so.1 /deps \
&& cp --parents /lib64/libdl.so.2 /deps \
&& cp --parents /lib64/libtinfo.so.5 /deps
FROM busybox:1.31.1-glibc
ENV PATH=/usr/local/epics/base/bin/linux-x86_64:$PATH
WORKDIR /usr/local/epics
COPY --from=builder /usr/local/epics .
WORKDIR /
COPY --from=builder /deps/lib64/*.so.* /lib64/
EXPOSE 5065/tcp 5064/tcp
EXPOSE 5065/udp 5064/udp
ENTRYPOINT ["softIoc"]
CMD ["-d", "/db/softioc.db"]