question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Describe the problems you are having I just want to avoid Java tool chain in my system, since I don’t know anything about Java. Yes it sounds really stupid 😃

Describe the solution you’d like It would be nice to have a Docker image alongside the release. Some linting tools (which are hard to build from source) support this alternative method like hadolint. You don’t need to publish it to DockerHub though. Just a Dockerfile file is helpful enough. Publishing it through GitHub container registry is also an option.

Additional context I have a working image, simply by just spinning up an Alpine base, copying the release over and installing opendjdk11-jdk on it. It works but not ideal. A Dockerfile file with detailed build instruction would be nice (I can’t seem to find the build from source instruction anywhere).

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
FollieHiyukicommented, Aug 13, 2022

@valentjn I checked the CI configuration and realized that I forgot to generate the completion lists. This is my new Dockerfile, which seems to work fine for Markdown and LaTEX files (I still can’t get things to work in Org file).

FROM maven:3-eclipse-temurin-11-alpine AS builder
ARG LTEX_VERSION=15.2.0
# Install build dependencies
RUN apk add --no-cache python3 \
    && ln -sf /usr/bin/python3 /usr/bin/python
# Download the release
RUN wget -q https://github.com/valentjn/ltex-ls/archive/refs/tags/${LTEX_VERSION}.tar.gz \
    && tar -xzf ${LTEX_VERSION}.tar.gz \
    && rm -vf ${LTEX_VERSION}.tar.gz \
    && mv -v ltex-ls-${LTEX_VERSION} ltex-ls-src
WORKDIR /ltex-ls-src
# Generate completion lists
RUN python -u tools/createCompletionLists.py
# Build
RUN mvn --quiet --errors package -DskipTests
# Package binary
RUN tar -xzf target/ltex-ls-${LTEX_VERSION}.tar.gz \
    && mv -v ltex-ls-${LTEX_VERSION} /ltex-ls

FROM eclipse-temurin:11-jre-alpine
# Add a normal user to run the program
RUN adduser -D -s /sbin/nologin -h /ltex-ls ltex
USER ltex
# Copy artifacts from builder
WORKDIR /ltex-ls
COPY --from=builder /ltex-ls/ ./
# Entrypoint
ENTRYPOINT ["/ltex-ls/bin/ltex-ls"]

Build: podman build -f Dockerfile -t ltex-ls . Run using a wrapper script:

#!/bin/sh

podman run \
    --cap-drop ALL \
    --security-opt no-new-privileges \
    --read-only \
    --rm --interactive \
    localhost/ltex-ls "$@"

The container image is built from the Github release. I can send a PR getting this into the repo (with some changes to fit your workflow).

0reactions
sanmai-NLcommented, Nov 18, 2022

@FollieHiyuki: Please do! Being able to reuse this Docker images saves a lot of electricity and time for all those using dev containers with ltex-ls.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker image - Docker Documentation
docker image : Manage images. ... Show the history of an image. docker image import, Import the contents from a tarball to create...
Read more >
What is a Docker Image? Introduction and use cases
A Docker image is a file used to execute code in a Docker container. Docker images act as a set of instructions to...
Read more >
Understanding and Building Docker Images - JFrog
A Docker image is a read-only template that contains a set of instructions for creating a container that can run on the Docker...
Read more >
Quickstart: Build and push a Docker image with Cloud Build
Artifact Registry provides a single location for managing private packages and Docker container images. You will first build the image using a Dockerfile...
Read more >
Creating a container image for use on Amazon ECS
Amazon ECS uses Docker images in task definitions to launch containers. Docker is a technology that provides the tools for you to build,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found