Skip to content

Commit

Permalink
base: add musl build.
Browse files Browse the repository at this point in the history
This is intended mainly for building fully static IOCs to be deployed on
older machines. We are using Alpine since it's the main musl-based
distro with LTS releases.

We also document it in README and CHANGES.
  • Loading branch information
ericonr committed Nov 29, 2023
1 parent dcd0409 commit 5910baa
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* This copies libraries built from source in the build image to the runtime
image for all targets. This removes the need to use `RUNTIME_TAR_PACKAGES`
for local libraries required during a module build.
* base: add musl build. by @ericonr in
https://github.com/cnpem/epics-in-docker/pull/35

## v0.4.0

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,13 @@ appropriate):
```
$ docker exec -ti <container> nc -U ioc.sock
```

## Alpine base image

This alternative base image can be used to build fully static IOCs for
scenarios where containerized deployment isn't an option or isn't desired for
some reason. It should also be able to cope better than the Debian-based
default image with older kernels.

It can be obtained directly from the [GitHub
registry](https://github.com/cnpem/epics-in-docker/pkgs/container/lnls-alpine-3.18-epics-7).
1 change: 1 addition & 0 deletions base/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DEBIAN_VERSION=11.7
ALPINE_VERSION=3.18.4

EPICS7_BASE_VERSION=7.0.7

Expand Down
1 change: 1 addition & 0 deletions base/musl/.env
55 changes: 55 additions & 0 deletions base/musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
ARG ALPINE_VERSION

FROM alpine:$ALPINE_VERSION

ARG JOBS

RUN apk add --no-cache \
bash \
g++ \
libevent-dev \
libevent-static \
libtirpc-dev \
libtirpc-static \
linux-headers \
make \
musl-dev \
ncurses-terminfo \
patch \
perl \
rpcsvc-proto \
gcc \
meson \
re2c \
readline-dev \
readline-static

COPY lnls-get-n-unpack.sh /usr/local/bin/lnls-get-n-unpack
COPY lnls-run.sh /usr/local/bin/lnls-run

ARG EPICS_BASE_VERSION
ENV EPICS_BASE_PATH /opt/epics/base
ENV EPICS_MODULES_PATH /opt/epics/modules
ENV EPICS_RELEASE_FILE /opt/epics/RELEASE

WORKDIR /opt/epics
COPY install-functions.sh .

COPY backport-epics-base-musl.patch .
COPY install_epics.sh .
RUN ./install_epics.sh

ARG SEQUENCER_VERSION
ARG CALC_VERSION
ARG ASYN_VERSION
ARG STREAMDEVICE_VERSION
ARG BUSY_VERSION
ARG AUTOSAVE_VERSION
ARG SSCAN_VERSION
ARG RECCASTER_VERSION
ARG IPAC_VERSION
ARG CAPUTLOG_VERSION

WORKDIR ${EPICS_MODULES_PATH}
COPY install_modules.sh .
RUN NEEDS_TIRPC=YES ./install_modules.sh
24 changes: 24 additions & 0 deletions base/musl/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
services:
epics-base:
image: ${REGISTRY:-ghcr.io/cnpem}/lnls-alpine-3.18-epics-7:$TAG
build:
context: ../
dockerfile: musl/Dockerfile
labels:
org.opencontainers.image.revision: ${TAG}
org.opencontainers.image.source: ${SOURCE:-https://github.com/cnpem/epics-in-docker}
org.opencontainers.image.description: "EPICS base and modules build image for fully static executables"
args:
JOBS: ${JOBS:-1}
ALPINE_VERSION: ${ALPINE_VERSION}
EPICS_BASE_VERSION: ${EPICS7_BASE_VERSION}
SEQUENCER_VERSION: ${SEQUENCER_VERSION}
CALC_VERSION: ${CALC_VERSION}
ASYN_VERSION: ${ASYN_VERSION}
STREAMDEVICE_VERSION: ${STREAMDEVICE_VERSION}
BUSY_VERSION: ${BUSY_VERSION}
AUTOSAVE_VERSION: ${AUTOSAVE_VERSION}
SSCAN_VERSION: ${SSCAN_VERSION}
RECCASTER_VERSION: ${RECCASTER_VERSION}
IPAC_VERSION: ${IPAC_VERSION}
CAPUTLOG_VERSION: ${CAPUTLOG_VERSION}

0 comments on commit 5910baa

Please sign in to comment.