Skip to content

Commit

Permalink
fix security opt in phoebus launch
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Dec 10, 2024
1 parent 58445c5 commit 991a5ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 4.1.0
_commit: 4.1.0-4-ged64dd7
_src_path: gh:epics-containers/ioc-template
description: Generic IOC for the Delta Tau turbo pmac and power pmac motion controllers
git_platform: github.com
Expand Down
10 changes: 4 additions & 6 deletions opi/phoebus-launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ settings="
-settings /tmp/settings.ini
"

if which phoebus.sh &>/dev/null ; then
if which phoebus.sh &>/dev/null && [[ -z ${use_container} ]] ; then
echo "Using phoebus.sh from PATH"
set -x
phoebus.sh ${settings} "${@}"

elif module load phoebus 2>/dev/null; then
elif module load phoebus 2>/dev/null && [[ -z ${use_container} ]] ; then
echo "Using phoebus module"
set -x
phoebus.sh ${settings} "${@}"
Expand All @@ -33,16 +33,14 @@ else
# prefer podman but use docker if USE_DOCKER is set
if podman version &> /dev/null && [[ -z $USE_DOCKER ]]
then docker=podman; UIDGID=0:0
else docker=docker; UIDGID=$(id -u):$(id -g)
else docker=docker; UIDGID=$(id -u):$(id -g); xhost +SI:localuser:$(id -un)
fi
echo "Using $docker as container runtime"

# ensure local container users can access X11 server
xhost +SI:localuser:$(id -un)

# settings for container launch
x11="-e DISPLAY --net host"
args="--rm -it --security-opt=label=none --user ${UIDGID}"
args="--rm -it --security-opt=label=disable --user ${UIDGID}"
mounts="-v=/tmp:/tmp -v=${workspace}:/workspace -v=${workspace}/..:/workspaces"
image="ghcr.io/epics-containers/ec-phoebus:latest"

Expand Down

0 comments on commit 991a5ab

Please sign in to comment.