Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gromacs container with a Non Root User #13

Open
hovo1990 opened this issue Jan 14, 2021 · 0 comments
Open

Gromacs container with a Non Root User #13

hovo1990 opened this issue Jan 14, 2021 · 0 comments

Comments

@hovo1990
Copy link

hovo1990 commented Jan 14, 2021

Hello,

Update 2: A better option is also sync docker container time with host OS:
alias gmx='docker run --rm --gpus all -v "$PWD":/data -v /etc/localtime:/etc/localtime:ro -w /data -u $(id -u):$(id -g) -it gromacs/gromacs gmx'

Update 1: My previous comment in adding a user does not work, a much simpler solution is running gromacs docker using the following command:
docker run --rm --gpus all -v "$PWD":/data -w /data -u $(id -u):$(id -g) -it gromacs/gromacs gmx pdb2gmx -f test.pdb

OLD:
Thank you very much for the docker container.
Wouldn't it be better if the docker container user was not "root"?
Right now, launching commands generates files as a "root" user, which then the file permission needs to be changed.
Below code is a potential solution.

FROM  gromacs/gromacs

# Create a non-root user
ARG username=gromacs
ARG uid=1000
ARG gid=100
ENV USER $username
ENV UID $uid
ENV GID $gid
ENV HOME /home/$USER

RUN adduser --disabled-password \
--gecos "Non-root user" \
--uid $UID \
--gid $GID \
--home $HOME \
$USER

USER $USER
WORKDIR /data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant