diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f4b1198 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +.github diff --git a/Dockerfile b/Dockerfile index ec80734..c673984 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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; \ @@ -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; \ @@ -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 diff --git a/config/.vimrc b/config/.vimrc index 818f569..dab75ef 100644 --- a/config/.vimrc +++ b/config/.vimrc @@ -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 diff --git a/config/starship.toml b/config/starship.toml index a7990b2..e580991 100644 --- a/config/starship.toml +++ b/config/starship.toml @@ -9,8 +9,9 @@ min_time = 300000 [directory] truncation_length = 8 +read_only = " " -[docker] +[docker_context] disabled = false symbol = " " style = "bold #2496ED" @@ -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 = "ﲴ " @@ -78,9 +78,6 @@ symbol = " " [golang] symbol = " " -[haskell] -symbol = " " - [hg_branch] symbol = " " diff --git a/python.pkgs b/python.pkgs index f979d13..4d4598a 100644 --- a/python.pkgs +++ b/python.pkgs @@ -13,4 +13,3 @@ awscli azure-cli requests[security] dns-lexicon[full] -pyopenssl<20.0.0