diff --git a/build-ioc.sh b/build-ioc.sh new file mode 100755 index 0000000..cb6843a --- /dev/null +++ b/build-ioc.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +set -ex + +cp /opt/epics/RELEASE configure/ +cat << EOF > configure/CONFIG_SITE.local +STATIC_BUILD=YES +FULL_STATIC_BUILD=YES +USR_LDFLAGS = -static-pie +# TODO: add to base image +COMMANDLINE_LIBRARY = READLINE_NCURSES +EOF + +# TODO: add to base image +apk add git ncurses-static + +git config --global --add safe.directory $PWD + +make distclean +make +make clean +make -C iocBoot + +version=$(git describe) + +echo $version > rffe-epics-ioc-version +echo ".git/" > /tmp/globs +# this trick is done so the resulting tarball has a root rffe-epics-ioc/ directory +(cd .. && tar caf rffe-epics-ioc/rffe-epics-ioc-${version}.tar.gz -X /tmp/globs rffe-epics-ioc/) +rm rffe-epics-ioc-version + +make distclean diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b48c744 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +services: + build-static-ioc: + image: ghcr.io/cnpem/lnls-alpine-3.18-epics-7:v0.10.0-dev + volumes: + - type: bind + source: ./ + target: /opt/rffe-epics-ioc + working_dir: /opt/rffe-epics-ioc + command: ./build-ioc.sh