Skip to content

Commit

Permalink
Add Docker file to run independent of host OS
Browse files Browse the repository at this point in the history
I got spooked by the --break-system-packages flag
  • Loading branch information
LoyVanBeek authored and Rayman committed Dec 20, 2024
1 parent be43587 commit 204a3a1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:22.04

RUN /bin/bash -c "apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -yy -q python3-numpy python3-pygame python3-scipy python3-tqdm python3-pip python3-pandas\
&& rm -rf /var/lib/apt/lists/*"
RUN python3 -m pip install --user pygame_widgets

RUN mkdir -p /root/coding-challenge-racer
WORKDIR /root/coding-challenge-racer

COPY --link . .

ENTRYPOINT [ "python3", "tournament.py", "Zandvoort"]
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
services:
# Base image containing dependencies.
base:
image: racer
build:
context: .
dockerfile: Dockerfile
# Interactive shell
stdin_open: true
tty: true
# Networking and IPC for ROS 2
network_mode: host
# Needed to display graphical applications
privileged: true
environment:
# Allows graphical programs in the container.
- DISPLAY=${DISPLAY}
- QT_X11_NO_MITSHM=1
- NVIDIA_DRIVER_CAPABILITIES=all
volumes:
# Allows graphical programs in the container.
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ${XAUTHORITY:-$HOME/.Xauthority}:/root/.Xauthority

0 comments on commit 204a3a1

Please sign in to comment.