Skip to content

Commit ea7c4f3

Browse files
committed
Make dev container compatible with podman
Following the issue described in InfiniTimeOrg#174 (comment). 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.
1 parent 8cb1ef4 commit ea7c4f3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhisto
4848
&& chown -R $USERNAME /commandhistory \
4949
&& echo "$SNIPPET" >> "/home/$USERNAME/.bashrc"
5050

51-
USER ubuntu
52-
5351
# Section for interactive compilation during docker run
5452

5553
WORKDIR /sources

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ docker build -t infinisim-build .devcontainer
121121

122122
Afterwards you can build the simulator with:
123123
```sh
124-
docker run --rm -it -v ${PWD}:/sources infinisim-build
124+
docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinisim-build
125125
```
126126

127127
By default this builds the simulator using the InfiniTime files from the submodule in your `${PWD}`.
128128
If you want to use a different repository, you got to mount it and pass the path to the `INFINITIME_DIR` variable:
129129
```sh
130-
docker run --rm -it -v ${PWD}:/sources -v ${PWD}/../InfiniTime:/infinitime -e INFINITIME_DIR=/infinitime infinisim-build
130+
docker run --rm -it -v ${PWD}:/sources -v ${PWD}/../InfiniTime:/infinitime -e INFINITIME_DIR=/infinitime --user $(id -u):$(id -g) infinisim-build
131131
```
132132

133133
Other CMake generation and build arguments can be passed to the `GENERATE_ARGS` and `BUILD_ARGS` variables:
134134
```sh
135-
docker run --rm -it -v ${PWD}:/sources -e GENERATE_ARGS=-DENABLE_USERAPPS="Apps::Timer,Apps::Alarm" -e BUILD_ARGS=-j16 infinisim-build
135+
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
136136
```
137137

138138

0 commit comments

Comments
 (0)