From 6ec8eb2e25e7a1d53b299c9f349a6a76dd6542ac Mon Sep 17 00:00:00 2001 From: giles knap Date: Wed, 3 Dec 2025 19:50:45 +0000 Subject: [PATCH 1/3] use epics-containers base image in client Dockerfile --- client/Dockerfile | 50 ++--------------------------------- client/ioc-compose.yml | 3 +-- client/iocBoot/iocdemo/st.cmd | 2 -- 3 files changed, 3 insertions(+), 52 deletions(-) diff --git a/client/Dockerfile b/client/Dockerfile index 5baf8c9e..6961f3fc 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,54 +1,8 @@ -# Download Epics -FROM --platform=$BUILDPLATFORM debian:bookworm-slim AS epics-download-extract -SHELL ["/bin/bash", "-c"] -RUN apt-get update && apt-get install -yq wget git -WORKDIR /var/cache -ARG EPICSVERSION=7.0.9 -RUN wget -q --show-progress https://epics-controls.org/download/base/base-$EPICSVERSION.tar.gz \ -&& mkdir /epics/ \ -&& tar -xf base-$EPICSVERSION.tar.gz -C /epics \ -&& rm base-$EPICSVERSION.tar.gz - -FROM --platform=$BUILDPLATFORM debian:bookworm-slim AS base - -FROM base AS base-amd64 -ENV EPICS_HOST_ARCH=linux-x86_64 - -FROM base AS base-386 -ENV EPICS_HOST_ARCH=linux-x86 - -FROM base AS base-arm64 -ENV EPICS_HOST_ARCH=linux-arm - -FROM base AS base-arm -ENV EPICS_HOST_ARCH=linux-arm - -# Now finally choose the right base image: -FROM base-$TARGETARCH AS build-epics -SHELL ["/bin/bash", "-c"] -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get install --no-install-recommends -yq \ - build-essential \ - ca-certificates \ - curl \ - libreadline-dev \ - telnet \ - && apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt - -WORKDIR /epics -COPY --from=epics-download-extract /epics /epics -ARG EPICSVERSION=7.0.9 -RUN mv base-$EPICSVERSION base -RUN cd base && make -j$(nproc) - -FROM build-epics AS recsync-base +FROM ghcr.io/epics-containers/epics-base-developer:7.0.9ec5 AS recsync-base WORKDIR /recsync COPY . /recsync/ -RUN mv docker/RELEASE.local configure/RELEASE.local -ENV EPICS_ROOT=/epics -ENV EPICS_BASE=${EPICS_ROOT}/base +RUN ln -s /epics/support/configure/RELEASE configure/RELEASE.local RUN make FROM recsync-base AS ioc-runner diff --git a/client/ioc-compose.yml b/client/ioc-compose.yml index 881c4f56..2193d137 100644 --- a/client/ioc-compose.yml +++ b/client/ioc-compose.yml @@ -1,7 +1,6 @@ - services: ioc1: - build: ../client + build: . environment: - IOCSH_NAME=IOC1 tty: true diff --git a/client/iocBoot/iocdemo/st.cmd b/client/iocBoot/iocdemo/st.cmd index 85594c30..fdea222e 100755 --- a/client/iocBoot/iocdemo/st.cmd +++ b/client/iocBoot/iocdemo/st.cmd @@ -3,8 +3,6 @@ ## You may have to change demo to something else ## everywhere it appears in this file -< envPaths - ## Register all support components dbLoadDatabase("../../dbd/demo.dbd",0,0) demo_registerRecordDeviceDriver(pdbbase) From 116fe7fe6f1cf5610cfbd626812347e522030191 Mon Sep 17 00:00:00 2001 From: giles knap Date: Wed, 3 Dec 2025 20:09:37 +0000 Subject: [PATCH 2/3] fix sonarkube concerns --- client/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/Dockerfile b/client/Dockerfile index 6961f3fc..cf1fed84 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -2,11 +2,11 @@ FROM ghcr.io/epics-containers/epics-base-developer:7.0.9ec5 AS recsync-base WORKDIR /recsync COPY . /recsync/ -RUN ln -s /epics/support/configure/RELEASE configure/RELEASE.local -RUN make +RUN ln -s /epics/support/configure/RELEASE configure/RELEASE.local && \ + make FROM recsync-base AS ioc-runner WORKDIR /recsync/bin/${EPICS_HOST_ARCH} -CMD ./demo /recsync/iocBoot/iocdemo/st.cmd +CMD ["./demo", "/recsync/iocBoot/iocdemo/st.cmd"] From f6214a18055a44aba261b6ab911560beb6cb8a35 Mon Sep 17 00:00:00 2001 From: giles knap Date: Thu, 4 Dec 2025 08:59:52 +0000 Subject: [PATCH 3/3] add stdin to ioc1 in client compose - so you can attach to its console --- client/ioc-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ioc-compose.yml b/client/ioc-compose.yml index 2193d137..f9a6038c 100644 --- a/client/ioc-compose.yml +++ b/client/ioc-compose.yml @@ -4,9 +4,9 @@ services: environment: - IOCSH_NAME=IOC1 tty: true + stdin_open: true networks: - net-1-recc-1 - networks: net-1-recc-1: driver: bridge