Posts

Showing posts with the label root

Adding not root user to Docker container

 Adding not root user to Docker container  in docker file: ARG USERNAME=containeruser ARG USER_UID=1000 ARG USER_GID=$USER_UID RUN groupadd --gid $USER_GID $USERNAME \     && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \     && chown -R $USER_UID:$USER_GID /home/$USERNAME     # [Optional] Add sudo support if needed     # && apt-get update && apt-get install -y sudo \     # && echo $USERNAME ALL=(root) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \     # && chmod 0440 /etc/sudoers.d/$USERNAME # Set the default user for all processes in the container (optional, but ensures everything runs as this user) # USER $USERNAME

Vagrant modifying the Owner/Group when mounts synced folders

Modifying the Owner/Group By default, Vagrant mounts the synced folders with the owner/group set to the SSH user. Sometimes it is preferable to mount folders with a different owner and group. It is possible to set these options: config . vm . synced_folder "src/" , "/srv/website" , owner: "root" , group: "root"   https://www.vagrantup.com/docs/synced-folders/basic_usage.html