From bf6f75ee5650d68d510a9e0ed4844ed237cfb061 Mon Sep 17 00:00:00 2001 From: pml68 Date: Sat, 1 Feb 2025 14:02:03 +0100 Subject: refactor: switch to „better” Dockerfile naming scheme [no ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker.yml | 2 +- Dockerfile.tex | 66 -------------------------------------------- tex.Dockerfile | 64 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 67 deletions(-) delete mode 100644 Dockerfile.tex create mode 100644 tex.Dockerfile diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2325d26..62b7ecc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,7 +17,7 @@ jobs: include: - dockerfile: 'Dockerfile' tag: 'neovim' - - dockerfile: 'Dockerfile.tex' + - dockerfile: 'tex.Dockerfile' tag: 'neovim-tex' runs-on: ubuntu-latest permissions: diff --git a/Dockerfile.tex b/Dockerfile.tex deleted file mode 100644 index 46a5ed9..0000000 --- a/Dockerfile.tex +++ /dev/null @@ -1,66 +0,0 @@ -FROM alpine:edge AS base -WORKDIR /root -SHELL ["/bin/sh", "-c"] - -RUN apk add --no-cache git \ - lazygit \ - neovim \ - man-pages \ - alpine-sdk \ - bash \ - eza \ - ncurses \ - util-linux-misc \ - curl \ - --update - -# install deps needed by neovim -RUN apk add --no-cache wget \ - gzip \ - neovim-doc \ - ripgrep \ - rustup \ - python3 \ - openjdk21 \ - openjdk17 \ - gradle \ - go \ - dotnet8-sdk \ - clang19-extra-tools \ - nodejs \ - npm - -# install TeX -RUN apk add --no-cache texlive \ - texlive-binextra \ - texmf-dist-fontutils \ - texmf-dist-fontsrecommended \ - texmf-dist-langenglish \ - texmf-dist-langeuropean \ - texmf-dist-latexextra \ - texmf-dist-latexrecommended \ - texmf-dist-pictures \ - texmf-dist-plaingeneric - -# pre-download lazy.nvim -RUN git clone --filter=blob:none https://github.com/folke/lazy.nvim.git --branch=stable /root/.local/share/nvim/lazy/lazy.nvim - -# set up Rust -RUN rustup-init -y --default-toolchain none && /root/.cargo/bin/rustup toolchain install nightly --allow-downgrade --profile minimal --component rustfmt,rust-src,clippy,rust-analyzer && echo -e "[unstable]\ngc = true" > /root/.cargo/config.toml - -# copy config files -COPY .bashrc .bashrc -COPY . .config/nvim - -FROM base -SHELL ["/bin/bash", "-c"] -WORKDIR /root -RUN nvim --headless +"Lazy! sync" +qa; rm -rf /root/.cache - -# symlink the clangd executable, since it can't be installed with mason -# also symlink rust-analyzer -RUN ln -sf /usr/bin/clangd /root/.local/share/nvim/mason/bin/clangd && ln -sf /root/.rustup/toolchains/nightly-x86_64-unknown-linux-musl/bin/rust-analyzer /root/.local/share/nvim/mason/bin/rust-analyzer - -ENTRYPOINT ["/bin/bash"] - -# vi: ft=dockerfile diff --git a/tex.Dockerfile b/tex.Dockerfile new file mode 100644 index 0000000..8d04f2a --- /dev/null +++ b/tex.Dockerfile @@ -0,0 +1,64 @@ +FROM alpine:edge AS base +WORKDIR /root +SHELL ["/bin/sh", "-c"] + +RUN apk add --no-cache git \ + lazygit \ + neovim \ + man-pages \ + alpine-sdk \ + bash \ + eza \ + ncurses \ + util-linux-misc \ + curl \ + --update + +# install deps needed by neovim +RUN apk add --no-cache wget \ + gzip \ + neovim-doc \ + ripgrep \ + rustup \ + python3 \ + openjdk21 \ + openjdk17 \ + gradle \ + go \ + dotnet8-sdk \ + clang19-extra-tools \ + nodejs \ + npm + +# install TeX +RUN apk add --no-cache texlive \ + texlive-binextra \ + texmf-dist-fontutils \ + texmf-dist-fontsrecommended \ + texmf-dist-langenglish \ + texmf-dist-langeuropean \ + texmf-dist-latexextra \ + texmf-dist-latexrecommended \ + texmf-dist-pictures \ + texmf-dist-plaingeneric + +# pre-download lazy.nvim +RUN git clone --filter=blob:none https://github.com/folke/lazy.nvim.git --branch=stable /root/.local/share/nvim/lazy/lazy.nvim + +# set up Rust +RUN rustup-init -y --default-toolchain none && /root/.cargo/bin/rustup toolchain install nightly --allow-downgrade --profile minimal --component rustfmt,rust-src,clippy,rust-analyzer && echo -e "[unstable]\ngc = true" > /root/.cargo/config.toml + +# copy config files +COPY .bashrc .bashrc +COPY . .config/nvim + +FROM base +SHELL ["/bin/bash", "-c"] +WORKDIR /root +RUN nvim --headless +"Lazy! sync" +qa; rm -rf /root/.cache + +# symlink the clangd executable, since it can't be installed with mason +# also symlink rust-analyzer +RUN ln -sf /usr/bin/clangd /root/.local/share/nvim/mason/bin/clangd && ln -sf /root/.rustup/toolchains/nightly-x86_64-unknown-linux-musl/bin/rust-analyzer /root/.local/share/nvim/mason/bin/rust-analyzer + +ENTRYPOINT ["/bin/bash"] -- cgit v1.2.3