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

added zsh as default shell and user owner #11

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions devcontainer_images/src/miniconda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ RUN curl -sL https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz | tar -xz
rm -rf /var/lib/apt/lists/*

ARG USERNAME=devcon
ARG USER_GID=1000
ARG USER_HOME="/home/${USERNAME}"
RUN groupadd --gid 1000 ${USERNAME} && \
useradd -s /bin/bash --gid 1000 -m ${USERNAME} && \
RUN groupadd --gid ${USER_GID} ${USERNAME} && \
useradd -s /bin/bash --gid ${USER_GID} -m ${USERNAME} && \
echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} && \
chmod 0440 /etc/sudoers.d/${USERNAME}

Expand All @@ -69,7 +70,9 @@ RUN OMZ_DIR=${USER_HOME}/.oh-my-zsh && \
echo "$(cat "${ZSHRC_TEMPLATE_FILE}")\nDISABLE_AUTO_UPDATE=false\nDISABLE_UPDATE_PROMPT=false" > ${USER_HOME}/.zshrc && \
cd ${OMZ_DIR} && \
git repack -a -d -f --depth=1 --window=1 && \
echo "zsh" >> ${USER_HOME}/.bashrc
echo "auth sufficient pam_rootok.so" >> /etc/pam.d/chsh && \
chsh --shell /bin/zsh ${USERNAME} && \
chown -R ${USER_GID}:${USERNAME} ${USER_HOME}/.zshrc

CMD [ "/bin/bash" ]

Expand All @@ -92,4 +95,5 @@ RUN set -x && \
find /opt/conda/ -follow -type f -name '*.a' -delete && \
find /opt/conda/ -follow -type f -name '*.js.map' -delete && \
/opt/conda/bin/conda update --all -y && \
/opt/conda/bin/conda clean -afy
/opt/conda/bin/conda clean -afy && \
chown -R ${USER_GID}:${USERNAME} /opt/conda
Loading