From faaf37c95442a1b839aa0571f21b05062b426ed4 Mon Sep 17 00:00:00 2001 From: pml68 Date: Mon, 2 Dec 2024 00:20:58 +0100 Subject: feat: add "no-tex" docker image --- .dockerignore | 3 +++ .github/workflows/docker.yml | 27 ++++++++++++++++++------- Dockerfile.no-tex | 48 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 7 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile.no-tex diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..93afbe0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +.github +lazy-lock.json diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6a2f5fd..7778d04 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,6 +12,18 @@ env: jobs: push: + strategy: + matrix: + image: [ + { + dockerfile: 'Dockerfile', + tag: '' + }, + { + dockerfile: 'Dockerfile.no-tex', + tag: 'no-tex-' + }, + ] runs-on: ubuntu-latest permissions: packages: write @@ -21,7 +33,7 @@ jobs: - uses: actions/checkout@v4 - name: Build image - run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" + run: docker build . --file ${{ matrix.image.dockerfile }} --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - name: Log in to registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin @@ -31,10 +43,11 @@ jobs: IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - [ "$VERSION" == "master" ] && VERSION=latest + TAG=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + [[ "${{ github.ref }}" == "refs/tags/"* ]] && TAG=$(echo $TAG | sed -e 's/^v//') + [ "$TAG" == "master" ] && TAG="latest" + TAG=${{ matrix.image.tag }}$TAG echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION + echo TAG=$TAG + docker tag $IMAGE_NAME $IMAGE_ID:$TAG + docker push $IMAGE_ID:$TAG diff --git a/Dockerfile.no-tex b/Dockerfile.no-tex new file mode 100644 index 0000000..3342c16 --- /dev/null +++ b/Dockerfile.no-tex @@ -0,0 +1,48 @@ +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 \ + rust \ + python3 \ + openjdk21 \ + openjdk17 \ + gradle \ + go \ + dotnet8-sdk \ + clang19-extra-tools \ + nodejs \ + npm + +# 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 + +# 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 +RUN ln -sf /usr/bin/clangd /root/.local/share/nvim/mason/bin/clangd + +ENTRYPOINT ["/bin/bash"] -- cgit v1.2.3