Skip to content

Commit

Permalink
[Without spack images] Remove non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexlHer committed Jan 14, 2023
1 parent 078362e commit 6989746
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 5 additions & 3 deletions .github/scripts/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG TZ=Europe/Paris

ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV OMPI_ALLOW_RUN_AS_ROOT=1
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

RUN cd /tmp \
&& git clone --recurse-submodules https://github.com/arcaneframework/framework \
Expand All @@ -29,6 +31,6 @@ RUN cd /tmp \
&& cmake --build /tmp/build --target install \
&& cd / && rm -rf /tmp/*

RUN useradd -ms /bin/bash arcane_user
USER arcane_user
WORKDIR /home/arcane_user
# RUN useradd -ms /bin/bash arcane_user
# USER arcane_user
# WORKDIR /home/arcane_user
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,17 @@ cd .github/scripts

In these images, Arcane is installed in the default installation
directory (`/usr/local`).
A user is also created and used by default. This is the user
`arcane_user`.
Note that `sudo` is not available, so if you want to run commands
as `root`, you need to specify the `root` user in the execute command:
`docker exec -u root -it <image> bash`.
If you want to compile an application using Arcane, it is not necessary
to specify the Arcane installation directory.

Here is a set of commands to compile and run `QAMA` in container :
```bash
# In a termuinal, with Podman or Docker installed.
# In a terminal, with Podman or Docker installed.
IMAGE_ID=$(docker pull ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_minimal_release_latest)
CONTAINER_ID=$(docker run -dt "$IMAGE_ID")
docker exec -it "$CONTAINER_ID" bash

# Interactive terminal of contener.
# Interactive terminal of container.
cd /tmp
git clone https://github.com/arcaneframework/arcane-benchs
mkdir build/
Expand Down

0 comments on commit 6989746

Please sign in to comment.