-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
115 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
FROM ubuntu:24.04 | ||
LABEL MAINTAINER="[email protected]" | ||
|
||
ARG user=user | ||
ARG vim_tag=v9.1.0758 | ||
ARG vim_tag=v9.1.0847 | ||
ARG nano_great_version=8 | ||
ARG nano_version=8.2 | ||
|
||
|
@@ -11,130 +10,109 @@ ENV DEBIAN_FRONTEND=noninteractive \ | |
LANGUAGE=en_US:en \ | ||
LC_ALL=en_US.UTF-8 | ||
|
||
RUN echo '';\ | ||
echo '================================';\ | ||
echo 'Image building begins ...';\ | ||
echo '================================';\ | ||
echo '';\ | ||
apt-get update && apt-get install -y --no-install-recommends apt-utils && apt-get upgrade -y;\ | ||
echo '';\ | ||
echo '================================';\ | ||
echo 'Setting date and timezone ...';\ | ||
echo '================================';\ | ||
echo '';\ | ||
apt-get install -y --no-install-recommends tzdata;\ | ||
ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime;\ | ||
dpkg-reconfigure -f noninteractive tzdata;\ | ||
echo '';\ | ||
echo '================================';\ | ||
echo 'Installing common packages ...';\ | ||
echo '================================';\ | ||
echo '';\ | ||
apt-get install -y --no-install-recommends sudo expect bash-completion build-essential openssl libssl-dev net-tools iputils-ping nmap lsof telnet cron rsyslog zip unzip p7zip-full curl wget locales git zsh gosu ca-certificates less rename screen sntp tshark gpg gpg-agent;\ | ||
echo '';\ | ||
echo '================================';\ | ||
echo 'Setting the locale ...';\ | ||
echo '================================';\ | ||
echo '';\ | ||
sed -i 's/# \(en_US\.UTF-8 .*\)/\1/g' /etc/locale.gen && locale-gen;\ | ||
echo '';\ | ||
echo '==================================';\ | ||
echo 'Setting root and default users ...';\ | ||
echo '==================================';\ | ||
echo '';\ | ||
useradd --create-home --shell /bin/bash ${user};\ | ||
adduser ${user} sudo;\ | ||
echo 'root:RootUser' | chpasswd;\ | ||
echo "${user}:APUser" | chpasswd;\ | ||
echo '';\ | ||
echo '=============================================';\ | ||
echo 'Installing apt software-properties-common ...';\ | ||
echo '=============================================';\ | ||
echo '';\ | ||
apt-get install -y --no-install-recommends software-properties-common;\ | ||
echo '';\ | ||
echo '==========================================';\ | ||
echo 'Installing ncurses and S-Lang packages ...';\ | ||
echo '==========================================';\ | ||
echo '';\ | ||
apt install -y --no-install-recommends libncursesw5-dev libslang2-dev;\ | ||
echo '';\ | ||
echo '================================';\ | ||
echo 'Installing newest Vim ...';\ | ||
echo '================================';\ | ||
echo '';\ | ||
cd /;\ | ||
git clone -b ${vim_tag} https://github.com/vim/vim.git vim;\ | ||
cd vim/src;\ | ||
make && make install;\ | ||
cd / && rm -rf vim;\ | ||
echo '';\ | ||
echo '================================';\ | ||
echo 'Installing newest GNU Nano ...';\ | ||
echo '================================';\ | ||
echo '';\ | ||
cd /;\ | ||
curl -OL https://www.nano-editor.org/dist/v${nano_great_version}/nano-${nano_version}.tar.xz /;\ | ||
tar xvf nano-${nano_version}.tar.xz -C / && cd /nano-${nano_version};\ | ||
./configure --enable-utf8;\ | ||
make && make install;\ | ||
cd .. && rm -rf nano-${nano_version} nano-${nano_version}.tar.xz;\ | ||
echo "include /usr/local/share/nano/*.nanorc" >> /root/.nanorc;\ | ||
echo "include /usr/local/share/nano/*.nanorc" >> /home/${user}/.nanorc;\ | ||
chown ${user}:${user} /home/${user}/.nanorc;\ | ||
echo '';\ | ||
echo '================================';\ | ||
echo 'Cleaning apt ...';\ | ||
echo '================================';\ | ||
echo '';\ | ||
apt-get autoremove -y;\ | ||
apt-get clean;\ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
USER ${user} | ||
RUN echo '';\ | ||
echo '================================';\ | ||
echo 'Installing Oh My Zsh ...';\ | ||
echo '================================';\ | ||
echo '';\ | ||
echo Y | sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)";\ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/home.bashrc -o /home/${user}/.bashrc;\ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/home.vimrc -o /home/${user}/.vimrc;\ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/home.zshrc -o /home/${user}/.zshrc;\ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/myzshtheme.zsh-theme -o /home/${user}/.oh-my-zsh/themes/myzshtheme.zsh-theme;\ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/myrootzshtheme.zsh-theme -o /home/${user}/.oh-my-zsh/themes/myrootzshtheme.zsh-theme;\ | ||
sed -i "s/ZSH=\"\/home\/user\/.oh-my-zsh\"/ZSH=\"\/home\/${user}\/.oh-my-zsh\"/g" /home/${user}/.zshrc;\ | ||
echo '';\ | ||
echo '==================================================================================';\ | ||
echo "${user}: Setting Git's default pager to less for displaying unicode characters ...";\ | ||
echo '==================================================================================';\ | ||
echo '';\ | ||
git config --global core.pager 'less --raw-control-chars' | ||
USER root | ||
RUN ln -s /home/${user}/.oh-my-zsh /root;\ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/root.bashrc -o /root/.bashrc;\ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/root.vimrc -o /root/.vimrc;\ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/root.zshrc -o /root/.zshrc;\ | ||
touch /root/.zsh_history;\ | ||
touch /home/${user}/.zsh_history && chown ${user}:${user} /home/${user}/.zsh_history;\ | ||
echo '';\ | ||
echo '=====================================';\ | ||
echo 'Changing the default shell to Zsh ...';\ | ||
echo '=====================================';\ | ||
echo '';\ | ||
chsh -s /bin/zsh;\ | ||
chsh -s /bin/zsh ${user};\ | ||
/bin/bash -c "touch /home/${user}/.oh-my-zsh/cache/{.zsh-update,grep-alias}";\ | ||
/bin/bash -c "chown ${user}:${user} /home/${user}/.oh-my-zsh/cache/{.zsh-update,grep-alias}";\ | ||
echo '';\ | ||
echo '===============================================================================';\ | ||
echo "root: Setting Git's default pager to less for displaying unicode characters ...";\ | ||
echo '===============================================================================';\ | ||
echo '';\ | ||
git config --global core.pager 'less --raw-control-chars';\ | ||
echo '';\ | ||
echo '================================';\ | ||
echo 'Image building finishes';\ | ||
RUN echo '' && \ | ||
echo '================================' && \ | ||
echo 'Image building begins ...' && \ | ||
echo '================================' && \ | ||
echo '' && \ | ||
apt-get update && apt-get install -y --no-install-recommends apt-utils && apt-get upgrade -y && \ | ||
echo '' && \ | ||
echo '================================' && \ | ||
echo 'Setting date and timezone ...' && \ | ||
echo '================================' && \ | ||
echo '' && \ | ||
apt-get install -y --no-install-recommends tzdata && \ | ||
ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime && \ | ||
dpkg-reconfigure -f noninteractive tzdata && \ | ||
echo '' && \ | ||
echo '================================' && \ | ||
echo 'Installing common packages ...' && \ | ||
echo '================================' && \ | ||
echo '' && \ | ||
apt-get install -y --no-install-recommends sudo expect bash-completion build-essential openssl libssl-dev net-tools \ | ||
iputils-ping nmap lsof telnet cron rsyslog zip unzip p7zip-full curl wget locales git zsh gosu apt-transport-https \ | ||
lsb-release ca-certificates less rename screen sntp tshark gpg gpg-agent gnupg2 software-properties-common && \ | ||
echo '' && \ | ||
echo '================================' && \ | ||
echo 'Setting the locale ...' && \ | ||
echo '================================' && \ | ||
echo '' && \ | ||
sed -i 's/# \(en_US\.UTF-8 .*\)/\1/g' /etc/locale.gen && locale-gen && \ | ||
echo '' && \ | ||
echo '================================' && \ | ||
echo 'Setting root ...' && \ | ||
echo '================================' && \ | ||
echo '' && \ | ||
echo 'root:RootUser' | chpasswd && \ | ||
echo '' && \ | ||
echo '=============================================' && \ | ||
echo 'Installing apt software-properties-common ...' && \ | ||
echo '=============================================' && \ | ||
echo '' && \ | ||
apt-get install -y --no-install-recommends software-properties-common && \ | ||
echo '' && \ | ||
echo '==========================================' && \ | ||
echo 'Installing ncurses and S-Lang packages ...' && \ | ||
echo '==========================================' && \ | ||
echo '' && \ | ||
apt-get install -y --no-install-recommends libncursesw5-dev libslang2-dev && \ | ||
echo '' && \ | ||
echo '================================' && \ | ||
echo 'Installing newest Vim ...' && \ | ||
echo '================================' && \ | ||
echo '' && \ | ||
cd / && \ | ||
git clone -b ${vim_tag} https://github.com/vim/vim.git vim && \ | ||
cd vim/src && \ | ||
make && make install && \ | ||
cd / && rm -rf vim && \ | ||
echo '' && \ | ||
echo '================================' && \ | ||
echo 'Installing newest GNU Nano ...' && \ | ||
echo '================================' && \ | ||
echo '' && \ | ||
cd / && \ | ||
curl -OL https://www.nano-editor.org/dist/v${nano_great_version}/nano-${nano_version}.tar.xz && \ | ||
tar xvf nano-${nano_version}.tar.xz -C / && cd /nano-${nano_version} && \ | ||
./configure --enable-utf8 && \ | ||
make && make install && \ | ||
cd .. && rm -rf nano-${nano_version} nano-${nano_version}.tar.xz && \ | ||
echo "include /usr/local/share/nano/*.nanorc" >> /root/.nanorc && \ | ||
echo '' && \ | ||
echo '================================' && \ | ||
echo 'Cleaning apt ...' && \ | ||
echo '================================' && \ | ||
echo '' && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
echo '' && \ | ||
echo '================================' && \ | ||
echo 'Installing Oh My Zsh ...' && \ | ||
echo '================================' && \ | ||
echo '' && \ | ||
echo Y | sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/root.bashrc -o /root/.bashrc && \ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/root.vimrc -o /root/.vimrc && \ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/root.zshrc -o /root/.zshrc && \ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/myzshtheme.zsh-theme -o /root/.oh-my-zsh/themes/myzshtheme.zsh-theme && \ | ||
curl -L https://raw.github.com/Wujidadi/Ubuntu-RC/main/myrootzshtheme.zsh-theme -o /root/.oh-my-zsh/themes/myrootzshtheme.zsh-theme && \ | ||
echo '' && \ | ||
echo '=====================================' && \ | ||
echo 'Changing the default shell to Zsh ...' && \ | ||
echo '=====================================' && \ | ||
echo '' && \ | ||
chsh -s /bin/zsh && \ | ||
/bin/bash -c "touch /root/.oh-my-zsh/cache/{.zsh-update,grep-alias}" && \ | ||
echo '' && \ | ||
echo '===============================================================================' && \ | ||
echo "root: Setting Git's default pager to less for displaying unicode characters ..." && \ | ||
echo '===============================================================================' && \ | ||
echo '' && \ | ||
git config --global core.pager 'less --raw-control-chars' && \ | ||
echo '' && \ | ||
echo '================================' && \ | ||
echo 'Image building finishes' && \ | ||
echo '================================' | ||
|
||
CMD [ "/bin/zsh", "-l" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters