Skip to content

Commit

Permalink
install: adjustments to avoid the need to modify PATH, due to new sym…
Browse files Browse the repository at this point in the history
…links, updated docker documentation to note using --entrypoint
  • Loading branch information
bharnden committed Sep 28, 2023
1 parent b89143b commit f67af05
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 10 deletions.
7 changes: 3 additions & 4 deletions daemon/core/scripts/gui.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import argparse
import logging
import shlex
import subprocess
from logging.handlers import TimedRotatingFileHandler

from core import utils
from core.gui import appconfig, images
from core.gui.app import Application

Expand Down Expand Up @@ -43,8 +42,8 @@ def main() -> None:
logging.getLogger("PIL").setLevel(logging.ERROR)

# enable xhost for root
cmd = shlex.split("xhost +SI:localuser:root")
subprocess.check_call(cmd)
if utils.which("xhost", False):
utils.cmd("xhost +SI:localuser:root")

# start app
images.load_all()
Expand Down
2 changes: 1 addition & 1 deletion daemon/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def close_onexec(fd: int) -> None:
fcntl.fcntl(fd, fcntl.F_SETFD, fdflags | fcntl.FD_CLOEXEC)


def which(command: str, required: bool) -> str:
def which(command: str, required: bool) -> Optional[str]:
"""
Find location of desired executable within current PATH.
Expand Down
1 change: 0 additions & 1 deletion dockerfiles/Dockerfile.centos
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ARG BRANCH=master
ENV LANG en_US.UTF-8
ARG PROTOC_VERSION=3.19.6
ARG VENV_PATH=/opt/core/venv
ENV PATH="$PATH:${VENV_PATH}/bin"
WORKDIR /opt

# install system dependencies
Expand Down
3 changes: 2 additions & 1 deletion dockerfiles/Dockerfile.centos-package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ LABEL Description="CORE CentOS Image"
ENV LANG en_US.UTF-8
ARG PROTOC_VERSION=3.19.6
ARG VENV_PATH=/opt/core/venv
ENV PATH="$PATH:${VENV_PATH}/bin"
WORKDIR /opt

# install basic dependencies
Expand Down Expand Up @@ -87,3 +86,5 @@ RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC
rm -rf protoc && \
rm -rf emane && \
rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip

WORKDIR /root
1 change: 0 additions & 1 deletion dockerfiles/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ARG BRANCH=master
ARG PROTOC_VERSION=3.19.6
ARG VENV_PATH=/opt/core/venv
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH="$PATH:${VENV_PATH}/bin"
WORKDIR /opt

# install system dependencies
Expand Down
1 change: 0 additions & 1 deletion dockerfiles/Dockerfile.ubuntu-package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ LABEL Description="CORE Docker Ubuntu Image"
ENV DEBIAN_FRONTEND=noninteractive
ARG PROTOC_VERSION=3.19.6
ARG VENV_PATH=/opt/core/venv
ENV PATH="$PATH:${VENV_PATH}/bin"
WORKDIR /opt

# install basic dependencies
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ cd core
# build image
sudo docker build -t core -f dockerfiles/Dockerfile.<centos,ubuntu> .
# start container
sudo docker run -itd --name core -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged core
sudo docker run -itd --name core -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged --entrypoint core-daemon core
# enable xhost access to the root user
xhost +local:root
# launch core-gui
Expand Down

0 comments on commit f67af05

Please sign in to comment.