From 3baa1b04c47fb1f7cb02f9e2230aa2209aa2ec93 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Sat, 11 Nov 2023 08:29:06 +0000 Subject: [PATCH] initial version --- Dockerfile | 34 ++++++++++++---------------------- README.md | 11 ++++------- phoebus.sh | 39 --------------------------------------- 3 files changed, 16 insertions(+), 68 deletions(-) delete mode 100755 phoebus.sh diff --git a/Dockerfile b/Dockerfile index e566f99..9e194d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,18 @@ -# Dockerfile for EPICS OPI PHoebus -FROM ubuntu:20.04 +# Dockerfile for yet another json schema validator +# The container provides some supply chain protection by building from source +# agains a commit hash -ENV DEBIAN_FRONTEND=noninteractive +FROM golang:1.21.4 as build -RUN apt-get update && apt-get install -y locales -RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ - dpkg-reconfigure --frontend=noninteractive locales && \ - update-locale LANG=en_US.UTF-8 +# get version yajsv 1.41 by commit hash +RUN git clone https://github.com/neilpa/yajsv.git && \ + cd yajsv && \ + git checkout 9889895863c595d38aa5d6347dfadb99f2687a51^{commit} -ENV LANG en_US.UTF-8 -RUN apt-get install -y \ - openjdk-11-jdk \ - maven \ - openjfx \ - git +RUN cd /go/yajsv && go build -o /yajsv -ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ -ENV ROOT=/phoebus -ENV VERSION=4.7.2 +FROM alpine:3.18.4 as runtime -RUN git clone https://github.com/ControlSystemStudio/phoebus.git \ - --branch=v${VERSION} ${ROOT} -WORKDIR ${ROOT} -RUN mvn -DskipTests clean install +COPY --from=build /yajsv /yajsv -RUN ln -s phoebus-product/target/product-${VERSION}.jar phoebus.jar -ENTRYPOINT ["java", "-jar", "phoebus.jar", "-server", "4918", "--add-modules=ALL-SYSTEM"] +ENTRYPOINT ["/yajsv"] diff --git a/README.md b/README.md index 3c25742..c12424c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ -# ec-phoebus -A container image for the Phoebus OPI tool for EPICS +# yzjsv -To launch: -```bash -curl -O https://raw.githubusercontent.com/epics-containers/ec-phoebus/main/phoebus.sh -bash phoebus.sh -``` +Container for yet at another json schema validator. + +Used by epics-containers to validate the EPICS IOC Instances. diff --git a/phoebus.sh b/phoebus.sh deleted file mode 100755 index 3f9bca3..0000000 --- a/phoebus.sh +++ /dev/null @@ -1,39 +0,0 @@ - -#!/bin/bash - -# A launcher for the phoebus container that allows X11 forwarding - -thisdir=$(realpath $(dirname ${BASH_SOURCE[0]})) - -if [[ $(docker --version 2>/dev/null) == *Docker* ]]; then - docker=docker -else - docker=podman - args="--security-opt=label=type:container_runtime_t" -fi - -XSOCK=/tmp/.X11-unix # X11 socket (but we mount the whole of tmp) -XAUTH=/tmp/.container.xauth.$USER -touch $XAUTH -xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge - -chmod 777 $XAUTH - -x11=" --e DISPLAY --v $XAUTH:$XAUTH --e XAUTHORITY=$XAUTH ---net host -" - -args=${args}" --it -" - -export MYHOME=/home/${USER} -mounts=" --v=/tmp:/tmp --v=${MYHOME}/.ssh:/root/.ssh -" - -set -x -$docker run ${mounts} ${args} ${x11} ghcr.io/epics-containers/ec-phoebus:latest