Skip to content

Commit

Permalink
Change Docker Username
Browse files Browse the repository at this point in the history
  • Loading branch information
joaofigueiredobisect committed Sep 24, 2024
1 parent 6a069a4 commit 54345fc
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 23 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ This will run the docker containers:

## Access the Development Container

This project includes a development container to facilitate code development. When the container is built for the first time, it is empty, and the repository needs to be downloaded again inside the container to build the project.

### Using VSCode

Install `ms-vscode-remote.remote-ssh` extension on vscode and enter on the container.
Expand All @@ -53,7 +55,11 @@ First you need to check you IP address. You can do it by running:

Once you know your ip address you enter the container by doing:

ssh -p 55555 bisect@{your-ip-address} -XY
ssh -p 55555 nmos@{your-ip-address} -XY

The password for the username is:

nmos

## Access NVIDIA NMOS Commissioning Controller Container

Expand Down
22 changes: 11 additions & 11 deletions images/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ ENV SSHD_PORT=55555
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "APT::Get::Assume-Yes "true";" > /etc/apt/apt.conf.d/90assumeyes

COPY scripts /opt/bisect/scripts
COPY scripts /opt/nmos/scripts

RUN apt-get update

RUN /opt/bisect/scripts/build-tools/add-user-bisect.sh
RUN /opt/bisect/scripts/build-tools/install-fish.sh
RUN /opt/bisect/scripts/build-tools/install-git.sh
RUN /opt/bisect/scripts/build-tools/install-conan.sh
RUN /opt/bisect/scripts/build-tools/install-cmake-x86.sh
RUN /opt/nmos/scripts/build-tools/add-user-nmos.sh
RUN /opt/nmos/scripts/build-tools/install-fish.sh
RUN /opt/nmos/scripts/build-tools/install-git.sh
RUN /opt/nmos/scripts/build-tools/install-conan.sh
RUN /opt/nmos/scripts/build-tools/install-cmake-x86.sh
RUN apt-get install -y \
vim clang-format rsync gdb gdbserver x11-apps xauth iproute2 build-essential
RUN apt-get install -y libgtk-3-dev ninja-build

RUN /opt/bisect/scripts/common/add-ssh-server.sh
RUN /opt/nmos/scripts/common/add-ssh-server.sh

RUN apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x \
Expand All @@ -41,8 +41,8 @@ RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100

RUN apt-get autoremove

RUN chmod +x /opt/bisect/scripts/launch.sh
RUN chmod +x /opt/nmos/scripts/launch.sh

WORKDIR /home/bisect
USER bisect
ENTRYPOINT /opt/bisect/scripts/launch.sh
WORKDIR /home/nmos
USER nmos
ENTRYPOINT /opt/nmos/scripts/launch.sh
3 changes: 1 addition & 2 deletions images/docker-compose-x86-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ services:
- PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native
volumes:
- ${XDG_RUNTIME_DIR}/pulse/native:${XDG_RUNTIME_DIR}/pulse/native
- ../volumes/home:/home/bisect/
- /.conan2:/home/bisect/.conan2:rw
- ../volumes/home:/home/nmos/

nmos-registry:
image: docker.io/rhastie/nmos-cpp:latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ set -eu
export DEBIAN_FRONTEND=noninteractive
apt-get install -y sudo --option=Dpkg::Options::=--force-confdef

adduser --disabled-password --gecos '' bisect
adduser bisect sudo
echo 'bisect:bisect' | chpasswd
adduser --disabled-password --gecos '' nmos
adduser nmos sudo
echo 'nmos:nmos' | chpasswd
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# access gst video plugins as non-root
usermod -aG video bisect
usermod -aG audio bisect
usermod -aG video nmos
usermod -aG audio nmos
2 changes: 1 addition & 1 deletion images/scripts/common/add-ssh-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ echo "X11UseLocalhost no";
echo "Port ${SSHD_PORT}";
echo "PasswordAuthentication yes";
echo "Subsystem sftp /usr/lib/openssh/sftp-server";
) > /etc/ssh/sshd_config_bisect
) > /etc/ssh/sshd_config_nmos

mkdir /run/sshd
6 changes: 3 additions & 3 deletions images/scripts/launch.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash
set -eu

HOME="/home/bisect"
HOME="/home/nmos"

if [ -d $HOME ]
then
echo "Directory $HOME exists."
sudo chown bisect.bisect $HOME
sudo chown nmos.nmos $HOME
else
echo "Directory $HOME does not exist."
mkdir $HOME
fi

# start ssh service
sudo /usr/sbin/sshd -D -e -f /etc/ssh/sshd_config_bisect
sudo /usr/sbin/sshd -D -e -f /etc/ssh/sshd_config_nmos

0 comments on commit 54345fc

Please sign in to comment.