Skip to content

Commit

Permalink
Upgrade to 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Wujidadi committed Nov 9, 2024
1 parent 3464c70 commit 057a112
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 128 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log (since version 0.17)

## 3.5 (2024-11-09)

* OS: **Ubuntu 24.04 LTS**
* Main software versions:
- **Vim 9.1.0847**
- **GNU Nano 8.2**
* User `user` has been removed, leaving only the `root` user to consolidate the RUN commands into a single layer, simplifying the overall structure.
* Replaced all `;` connectors with `&&` to catch errors during the build process.

## 3.4 (2024-10-05)

* OS: **Ubuntu 24.04 LTS**
Expand Down
230 changes: 104 additions & 126 deletions Dockerfile
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

Expand All @@ -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" ]
4 changes: 2 additions & 2 deletions test_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ docker buildx rm multiarch
docker buildx create --name multiarch --use

# Build the Docker image
docker buildx build --no-cache --progress=plain --push --platform linux/amd64,linux/arm64/v8 --rm -t wujidadi/ubuntu-tuned:3.4 -t wujidadi/ubuntu-tuned:latest . 2>&1 | tee $D/docker-build-ut-3.4.log
docker buildx build --no-cache --progress=plain --push --platform linux/amd64,linux/arm64/v8 --rm -t wujidadi/ubuntu-tuned:3.5 -t wujidadi/ubuntu-tuned:latest . 2>&1 | tee $D/docker-build-ut-3.5.log

# Create testing container
docker run -d -p 50000:80 -it --name Test wujidadi/ubuntu-tuned:3.4
docker run -d -p 50000:80 -it --name Test wujidadi/ubuntu-tuned:3.5

# Test the container outside itself by each command
docker exec -it Test vim --version | grep 'Included patches'
Expand Down

0 comments on commit 057a112

Please sign in to comment.