diff --git a/.github/workflows/buiild.yml b/.github/workflows/buiild.yml index a12b738..2f8380e 100644 --- a/.github/workflows/buiild.yml +++ b/.github/workflows/buiild.yml @@ -45,6 +45,7 @@ jobs: builder: ${{ steps.buildx.outputs.name }} push: ${{ steps.tag.outputs.do_push }} tags: | + ghcr.io/${{ github.repository }}:latest ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.image_tag }} # - name: Build runtime image diff --git a/Dockerfile b/Dockerfile index 528f022..e566f99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ # Dockerfile for EPICS OPI PHoebus FROM ubuntu:20.04 - ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y locales @@ -25,5 +24,5 @@ RUN git clone https://github.com/ControlSystemStudio/phoebus.git \ WORKDIR ${ROOT} RUN mvn -DskipTests clean install -ENTRYPOINT ["java", "-jar", "phoebus-product/target/product-${VERSION}.jar", \ - "-server", "4918", "--add-modules=ALL-SYSTEM"] +RUN ln -s phoebus-product/target/product-${VERSION}.jar phoebus.jar +ENTRYPOINT ["java", "-jar", "phoebus.jar", "-server", "4918", "--add-modules=ALL-SYSTEM"] diff --git a/phoebus.sh b/phoebus.sh new file mode 100755 index 0000000..3f9bca3 --- /dev/null +++ b/phoebus.sh @@ -0,0 +1,39 @@ + +#!/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