rename user
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Michael Grote 2024-07-30 11:11:07 +02:00
parent 4821253bc0
commit 66884a9bf1

View file

@ -2,7 +2,7 @@ FROM python:3.12.4-bookworm
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
# nötig damit die ansible-tools gefunden werden # nötig damit die ansible-tools gefunden werden
ENV PATH="$PATH:/home/ansible-user/.local/bin" ENV PATH="$PATH:/home/ansible-dev/.local/bin"
# hadolint ignore=DL3008 # hadolint ignore=DL3008
@ -38,18 +38,18 @@ RUN apt-get update \
# https://dev.to/izackv/running-a-docker-container-with-a-custom-non-root-user-syncing-host-and-container-permissions-26mb # https://dev.to/izackv/running-a-docker-container-with-a-custom-non-root-user-syncing-host-and-container-permissions-26mb
# hadolint ignore=DL3008 # hadolint ignore=DL3008
RUN addgroup --gid 2000 nonroot && \ RUN addgroup --gid 2000 nonroot && \
adduser --uid 2000 --gid 2000 --disabled-password --gecos "" ansible-user && \ adduser --uid 2000 --gid 2000 --disabled-password --gecos "" ansible-dev && \
echo 'ansible-user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers echo 'ansible-dev ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# Set the non-root user as the default user # Set the non-root user as the default user
USER ansible-user USER ansible-dev
WORKDIR /home/ansible-user/ WORKDIR /home/ansible-dev/
COPY --chown=ansible-user:ansible-user requirements.txt . COPY --chown=ansible-dev:ansible-dev requirements.txt .
COPY --chown=ansible-user:ansible-user requirements.yaml . COPY --chown=ansible-dev:ansible-dev requirements.yaml .
COPY --chown=ansible-user:ansible-user start_tmux.sh . COPY --chown=ansible-dev:ansible-dev start_tmux.sh .
COPY --chown=ansible-user:ansible-user version.sh . COPY --chown=ansible-dev:ansible-dev version.sh .
# hadolint ignore=DL3013 # hadolint ignore=DL3013
RUN python3 -m pip install --no-cache-dir --upgrade pip \ RUN python3 -m pip install --no-cache-dir --upgrade pip \
@ -68,8 +68,8 @@ RUN git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.v
&& rm ~/.bashrc \ && rm ~/.bashrc \
&& ln -s ~/dotfiles/.bash_extra ~/.bashrc \ && ln -s ~/dotfiles/.bash_extra ~/.bashrc \
&& vim +PluginInstall +qall \ && vim +PluginInstall +qall \
&& mkdir /home/ansible-user/ansible-homeserver && mkdir /home/ansible-dev/ansible-homeserver
ENTRYPOINT ["/home/ansible-user/start_tmux.sh"] ENTRYPOINT ["/home/ansible-dev/start_tmux.sh"]
#mount to non root user? #mount to non root user?