Debian Codegraph @

README-Dockerfile

raw
1 1
2 # README-Dockerfile-rt-tests
3
4 ## Introduction
5 This README provides detailed instructions for setting up an rt-tests container using Docker or Podman. This Dockerfile will pull a current copy of your code (plus all of your changes) and compile it into a container image for you to test with. This will give you an imbiguous way to test your changes, assuming you are running on a semi-modern host OS. The rt-tests container can be used to test any of the subpackages found under the rt-tests project, but is mainly intended for hwlatdetect and cyclictest.
6
7 ## Prerequisites
8 - Docker or Podman installed on your system.
9
10 ## Installation
11 ### Prepare Your Environment
12 - For EPEL systems (Fedora, CentOS, RHEL):
13 - Install Podman: `sudo dnf install podman -y`
14 - For Debian-based systems (Ubuntu):
15 - Install Docker: `sudo apt-get update && sudo apt-get install docker.io -y`
16 - Alternatively, install Podman: `sudo apt-get update && sudo apt-get install podman -y`
17
18 ### Build the Container
19 - Navigate to the root directory of the 'rteval'
20 - Build the container image named 'rteval-upstream':
21 - For Podman: `sudo podman build -t rt-tests-upstream .`
22 - For Docker: `sudo docker build -t rt-tests-upstream .`
23
24 ## Usage
25 ### Run the Container
26 - Start the container in privileged mode:
27 - For Podman: `sudo podman run -it --privileged rt-tests-upstream`
28 - For Docker: `sudo docker run -it --privileged rt-tests-upstream`
29 - This will create a long lasting container. In order to use it again (say after a reboot), you need to start and exec into the container to get yourself back into the shell:
30 - For Podman:
31 - `sudo podman start rt-tests-upstream`
32 - `sudo podman exec -it rt-tests-upstream /bin/bash`
33 - For Docker:
34 - `sudo docker start rt-tests-upstream`
35 - `sudo docker exec -it rt-tests-upstream /bin/bash`
36 - And to clean up and remove your container so you can test a new one:
37 - For Podman: `sudo podman rm -f rt-tests-upstream`
38 - For Docker: `sudo docker rm -f rt-tests-upstream`
39 - Please note that the above command does not cleanup the container when you are done. It can be useful to run a single use container when trying to only test a quick change and remove the container afterwards. To run a a single use container that removes itself immediately after you exit the shell, run the following commands with the `--rm` option:
40 - For Podman: `sudo podman run -it --rm --privileged rt-tests-upstream`
41 - For Docker: `sudo docker run -it --rm --privileged rt-tests-upstream`
42
43 ### Test rteval Build
44 - Inside the container, test one of the rt-tests packages you just built:
45 - Command: `cyclictest -D 1s`
46 - Command: `hwlatdetect --duration 1`
47
48 ## Conclusion
49 Follow these detailed steps for a successful rt-tests container setup using Docker or Podman.