From ea7c4f3593cf77e0385edecf46bca058529b5f41 Mon Sep 17 00:00:00 2001 From: Darius Arnold Date: Thu, 19 Jun 2025 18:53:45 +0200 Subject: [PATCH 1/2] Make dev container compatible with podman Following the issue described in https://github.com/InfiniTimeOrg/InfiniSim/pull/174#discussion_r2150883468. This prevents permission issues when using the dev container with podman, which is running rootless. Usage with docker requires explicitly passing UID and GID of the local user, which is added to the README. --- .devcontainer/Dockerfile | 2 -- README.md | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index df4af73..9f097ff 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -48,8 +48,6 @@ RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhisto && chown -R $USERNAME /commandhistory \ && echo "$SNIPPET" >> "/home/$USERNAME/.bashrc" -USER ubuntu - # Section for interactive compilation during docker run WORKDIR /sources diff --git a/README.md b/README.md index 9ac1747..8bf47a6 100644 --- a/README.md +++ b/README.md @@ -121,18 +121,18 @@ docker build -t infinisim-build .devcontainer Afterwards you can build the simulator with: ```sh -docker run --rm -it -v ${PWD}:/sources infinisim-build +docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinisim-build ``` By default this builds the simulator using the InfiniTime files from the submodule in your `${PWD}`. If you want to use a different repository, you got to mount it and pass the path to the `INFINITIME_DIR` variable: ```sh -docker run --rm -it -v ${PWD}:/sources -v ${PWD}/../InfiniTime:/infinitime -e INFINITIME_DIR=/infinitime infinisim-build +docker run --rm -it -v ${PWD}:/sources -v ${PWD}/../InfiniTime:/infinitime -e INFINITIME_DIR=/infinitime --user $(id -u):$(id -g) infinisim-build ``` Other CMake generation and build arguments can be passed to the `GENERATE_ARGS` and `BUILD_ARGS` variables: ```sh -docker run --rm -it -v ${PWD}:/sources -e GENERATE_ARGS=-DENABLE_USERAPPS="Apps::Timer,Apps::Alarm" -e BUILD_ARGS=-j16 infinisim-build +docker run --rm -it -v ${PWD}:/sources -e GENERATE_ARGS=-DENABLE_USERAPPS="Apps::Timer,Apps::Alarm" -e BUILD_ARGS=-j16 --user $(id -u):$(id -g) infinisim-build ``` From dad53c0bf05781f887b1cefcd2b4398be5760889 Mon Sep 17 00:00:00 2001 From: Darius Arnold Date: Fri, 20 Jun 2025 07:57:20 +0200 Subject: [PATCH 2/2] Add podman command to README.md Co-authored-by: NeroBurner --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 8bf47a6..50d3e1c 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,12 @@ Afterwards you can build the simulator with: docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinisim-build ``` +Note: when using rootless `podman` instead of `docker` the `--user` part can be left out. +The command to build the simulator using `podman` is: +```sh +podman run --rm -it -v ${PWD}:/sources infinisim-build +``` + By default this builds the simulator using the InfiniTime files from the submodule in your `${PWD}`. If you want to use a different repository, you got to mount it and pass the path to the `INFINITIME_DIR` variable: ```sh