Skip to content

Commit

Permalink
Update to python version 3.9
Browse files Browse the repository at this point in the history
* Updated starship config, vim version, python package list and improve dockerfile

Co-authored-by: Brian Rimek <[email protected]>
  • Loading branch information
rembik and rembik authored Nov 3, 2021
1 parent addaa67 commit ff45c4d
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
.github
81 changes: 53 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM python:3.8-alpine
FROM python:3.9-alpine

ENV DEFAULT_TZ=Europe/Berlin \
LANG=de_DE.UTF-8 \
LANGUAGE=de_DE.UTF-8 \
LC_ALL=de_DE.UTF-8
ENV TIMEZONE=${TIMEZONE:-Europe/Berlin} \
LANG=${LANGUAGE:-de_DE}.${ENCODING:-UTF-8} \
LANGUAGE=${LANGUAGE:-de_DE}.${ENCODING:-UTF-8} \
LC_ALL=${LANGUAGE:-de_DE}.${ENCODING:-UTF-8}

COPY python.pkgs /usr/local/share/pip/compile.pkgs
RUN set -eux; \
Expand Down Expand Up @@ -32,18 +32,22 @@ RUN set -eux; \
libxml2-dev \
libxslt-dev \
openssl-dev \
cargo \
rust \
gnupg \
tzdata \
; \
\
# Set timezone
cp /usr/share/zoneinfo/${DEFAULT_TZ} /etc/localtime; \
echo "${DEFAULT_TZ}" >/etc/timezone; \
cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime; \
echo "${TIMEZONE}" >/etc/timezone; \
\
# Install Ansible, Azure, AWS and DNS python packages
python -m pip install --upgrade pip; \
pip install --no-cache-dir pip-tools; \
pip-compile -qo /usr/local/share/pip/install.pkgs /usr/local/share/pip/compile.pkgs; \
pip install --no-cache-dir -r /usr/local/share/pip/install.pkgs; \
pip cache purge; \
\
# Install HashiCorp binaries
mkdir -p /usr/local/share/hashicorp; \
Expand All @@ -61,35 +65,56 @@ RUN set -eux; \

COPY config /tmp/config
RUN set -eux; \
# Install Starship shell prompt
# Configure shell
mv /tmp/config/.bashrc ~/.bashrc; \
if [ "$(uname -m)" = "x86_64" -a "$(getconf LONG_BIT)" = "64" ]; then \
# Insall shell prompt
curl -Os https://starship.rs/install.sh; \
chmod +x ./install.sh; \
./install.sh -V -f; \
rm install.sh; \
mkdir -p ~/.config; \
mv /tmp/config/starship.toml ~/.config/starship.toml; \
# Install fonts
apk --update add --no-cache \
fontconfig \
font-noto-emoji \
; \
wget -q https://github.com/ryanoasis/nerd-fonts/releases/latest/download/SourceCodePro.zip; \
mkdir -p /usr/share/fonts/nerd; \
unzip -d /usr/share/fonts/nerd SourceCodePro.zip; \
rm SourceCodePro.zip; \
find /usr/share/fonts/nerd/ -type f -name "*Windows Compatible.ttf" -exec rm -f {} \;; \
mv /tmp/config/nerd-emoji-font.conf /usr/share/fontconfig/conf.avail/05-nerd-emoji.conf; \
ln -s /usr/share/fontconfig/conf.avail/05-nerd-emoji.conf /etc/fonts/conf.d/05-nerd-emoji.conf; \
fc-cache -vf; \
# Install build-dependent system packages
apk add --no-cache --virtual .build-deps \
gcc \
make \
musl-dev \
ncurses-dev \
; \
# Install editor
git clone https://github.com/vim/vim.git /tmp/vim; \
cd /tmp/vim; \
./configure \
--with-features=huge \
--enable-multibyte \
--enable-python3interp=yes \
--with-python3-config-dir=$(python3-config --configdir) \
--enable-cscope \
--prefix=/usr/local \
; \
vim_version="$(git describe --tags $(git rev-list --tags --max-count=1) | sed -E 's/^v?([0-9]+)\.([0-9]+).*$/\1\2/')"; \
make VIMRUNTIMEDIR=/usr/local/share/vim/vim${vim_version}; \
make install; \
rm -rf /tmp/vim; \
mv /tmp/config/.vimrc ~/.vimrc; \
# vim -c 'PlugInstall' -c 'qa!'; \
\
apk del .build-deps; \
fi; \
mv /tmp/config/.bashrc ~/.bashrc; \
\
# Install vim editor and nerd fonts
apk --update add --no-cache \
fontconfig \
vim \
; \
apk --update add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/v3.13/community \
font-noto-emoji \
; \
wget -q https://github.com/ryanoasis/nerd-fonts/releases/latest/download/SourceCodePro.zip; \
mkdir -p /usr/share/fonts/nerd; \
unzip -d /usr/share/fonts/nerd SourceCodePro.zip; \
rm SourceCodePro.zip; \
find /usr/share/fonts/nerd/ -type f -name "*Windows Compatible.ttf" -exec rm -f {} \;; \
mv /tmp/config/nerd-emoji-font.conf /usr/share/fontconfig/conf.avail/05-nerd-emoji.conf; \
ln -s /usr/share/fontconfig/conf.avail/05-nerd-emoji.conf /etc/fonts/conf.d/05-nerd-emoji.conf; \
fc-cache -vf; \
mv /tmp/config/.vimrc ~/.vimrc; \
# vim -c 'PlugInstall' -c 'qa!'; \
rm -rf /tmp/config

WORKDIR /srv
Expand Down
2 changes: 1 addition & 1 deletion config/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Plug 'tpope/vim-fugitive' " https://github.com/tpope/vim-fugitive
Plug 'tmhedberg/SimpylFold' " https://github.com/tmhedberg/SimpylFold
Plug 'scrooloose/nerdcommenter' " https://github.com/scrooloose/nerdcommenter
Plug 'jiangmiao/auto-pairs' " https://github.com/jiangmiao/auto-pairs
Plug 'zxqfl/tabnine-vim' " https://github.com/codota/tabnine-vim
Plug 'codota/tabnine-vim' " https://github.com/codota/tabnine-vim
Plug 'scrooloose/nerdtree' " https://github.com/scrooloose/nerdtree
Plug 'alpertuna/vim-header' " https://github.com/alpertuna/vim-header
Plug 'ryanoasis/vim-devicons' " https://github.com/ryanoasis/vim-devicons
Expand Down
9 changes: 3 additions & 6 deletions config/starship.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ min_time = 300000

[directory]
truncation_length = 8
read_only = ""

[docker]
[docker_context]
disabled = false
symbol = ""
style = "bold #2496ED"
Expand Down Expand Up @@ -44,9 +45,8 @@ threshold = 4
disabled = false
symbol = ""
style = "dimmed green"
show_percentage = true
show_swap = false
threshold = 75
format = "$symbol [${ram_pct}]$(style) "

[terraform]
symbol = ""
Expand Down Expand Up @@ -78,9 +78,6 @@ symbol = " "
[golang]
symbol = ""

[haskell]
symbol = ""

[hg_branch]
symbol = ""

Expand Down
1 change: 0 additions & 1 deletion python.pkgs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ awscli
azure-cli
requests[security]
dns-lexicon[full]
pyopenssl<20.0.0

0 comments on commit ff45c4d

Please sign in to comment.