Improve editor/dockerfile

This commit is contained in:
david 2024-11-17 00:46:01 +01:00
parent c258754069
commit 65568ac27b

View file

@ -56,20 +56,53 @@ RUN \
bundle config set app_config ${GEM_HOME} bundle config set app_config ${GEM_HOME}
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
ARG HELIX_VERSION=24.07
RUN curl -L https://github.com/helix-editor/helix/releases/download/${HELIX_VERSION}/helix-${HELIX_VERSION}-x86_64-linux.tar.xz -o /tmp/helix.tar.xz && \
cd /opt/ && \
tar -xf /tmp/helix.tar.xz && \
ln -s /opt/helix-${HELIX_VERSION}-x86_64-linux/hx /usr/local/bin chmod +x /usr/local/bin/
USER ${NAME} USER ${NAME}
RUN mkdir -p ~/.config/fish && echo "set fish_greeting" >> ~/.config/fish/config.fish RUN mkdir -p ~/.config/fish ~/.config/helix
RUN \
echo >> ~/.config/fish/config.fish &&\ COPY <<FISH /home/app/.config/fish/config.fish
echo "function fish_prompt" >> ~/.config/fish/config.fish &&\ set fish_greeting
echo " set -l last_status \$status" >> ~/.config/fish/config.fish &&\
echo " set -l stat" >> ~/.config/fish/config.fish &&\ function fish_prompt
echo " if test \$last_status -ne 0" >> ~/.config/fish/config.fish &&\ set -l last_status \$status
echo " set stat (set_color red)\"[\$last_status]\"(set_color normal)" >> ~/.config/fish/config.fish &&\ set -l stat
echo " end" >> ~/.config/fish/config.fish &&\ if test \$last_status -ne 0
echo " string join '' -- (set_color green) (prompt_pwd) (set_color normal) \$stat ' 🐳 '" >> ~/.config/fish/config.fish && \ set stat (set_color red)\
echo "end" >> ~/.config/fish/config.fish end
string join '' -- (set_color green) (prompt_pwd) (set_color normal) \$stat ' 🐳 '
end
FISH
COPY <<LANGS /home/app/.config/helix/languages.toml
[[language]]
name = "ruby"
shebangs = ["ruby"]
roots = ["Gemfile.lock"]
language-servers = [ "ruby-lsp" ]
auto-format = true
[language-server.ruby-lsp]
command = "ruby-lsp"
args = ["--debug"]
LANGS
COPY <<CONF /home/app/.config/helix/config.toml
theme = "gruvbox_dark_hard"
[editor]
true-color = true
CONF
CMD ["/usr/bin/fish", "-l"]
FROM ruby:${RUBY_VERSION}-alpine AS builder FROM ruby:${RUBY_VERSION}-alpine AS builder