Skip to content

Experiment with docker container #3445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM ubuntu:24.04

RUN apt-get update && apt-get install -y software-properties-common wget fzf x11-apps

# RUN add-apt-repository ppa:kisak/kisak-mesa -y && apt update && apt upgrade -y
RUN add-apt-repository ppa:oibaf/graphics-drivers -y && apt update && apt upgrade -y

# RUN apt-get update && apt-get install -y \
# mesa-utils \
# libgl1-mesa-dri \
# libgl1-mesa-glx \
# && rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y \
mesa-utils \
libgl1 \
libglx-mesa0

WORKDIR /Software
COPY . .

# Redirecting sudo to a dummy command
RUN echo "#!/bin/bash\n\$@" > /usr/bin/sudo
RUN chmod +x /usr/bin/sudo

# Setup the sofrware environment
RUN chmod +x ./environment_setup/setup_software.sh && ./environment_setup/setup_software.sh

# Build bazel cache
# RUN ["bazel", "build", "//software/thunderscope:thunderscope_main"]

ENV QMLSCENE_DEVICE=softwarecontext
ENV QT_OPENGL=software
ENV LIBGL_ALWAYS_SOFTWARE=1
ENV LIBGL_ALWAYS_INDIRECT=1


WORKDIR /Software/src
CMD ["/bin/bash"]

37 changes: 37 additions & 0 deletions tests_done.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Run on Ubu24
sudo docker run --rm -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v $HOME/.cache:/root/.cache --name test test:latest

# Run on Mac
sudo docker run --rm -it -e DISPLAY=host.docker.internal:0 --mount type=bind,source=$HOME/Programs/Thunderbot/.cache,target=/root/.cache --mount type=bind,source=$HOME/Programs/Thunderbot/Software,target=/Software -v /tmp/.X11-unix:/tmp/.X11-unix --privileged --name testv1 --net=host test:0.1

# Run bazel inside docker
bazel run //software/thunderscope:thunderscope_main


# Clearing:
sudo docker system prune

# Building:
sudo docker build -t test:latest .


# To fix -> MESA: error: ZINK: failed to choose pdev & glx: failed to create drisw screen

sudo add-apt-repository ppa:kisak/kisak-mesa -y && sudo apt update && sudo apt upgrade -y

export QMLSCENE_DEVICE=softwarecontext
export QT_OPENGL=software
export LIBGL_ALWAYS_SOFTWARE=1

# To fix -> No matching fbConfigs or visuals found
export LIBGL_ALWAYS_INDIRECT=1

apt-get update && apt-get install -y libglvnd-dev libxi-dev libxrandr-dev libx11-dev libfontconfig1-dev libfreetype6-dev qt5-qmake qtbase5-dev qtchooser qtbase5-dev-tools xvfb mesa-utils gdb

# opengl testing command
glxinfo
glxgears

# Enable IGLX on host
xhost +
defaults write org.xquartz.X11 enable_iglx -bool true