Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simplified Docker image #4244

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

mawildoer
Copy link

@mawildoer mawildoer commented Apr 22, 2023

G'day team!

TLDR; ANTLR is super easy to use, but matching Java installs and versions across architectures etc... can be painful. This provides a simple cross-platform, cross-architecture way to get started with ANTLR

I am a complete beginner with Java and ANTLR. I have just started working through the docs and with some examples, but found getting off the ground with Java on my ARM Macbook air a little tough - especially since ANTLR itself seems otherwise so sleek and seamless.

I took a look online at dockerhub and found various other users have contributed their pre-built docker images back to the community https://hub.docker.com/search?q=antlr , but all(/all I sifted through) on x86-64, some many years ago and all with unclear backgrounds, builds, versions etc...

I gave the existing image build a whirl, but ran into an issue where the JRE base image wasn't ARM compatible either and the builds hung (seemingly indefinitely?)

My eventual solution worked without a hitch though; take a slightly larger albeit widely compatible base JRE image and install the prebuilt ANTLR tool in it. It worked so much more easily than various existing methods I tried that I wanted to make sure it was available to others and figured a good start to that was a conversation here about it's potential place in the ANTLR world. 😊

Extended goals:

  • I'd love to/happily help with setting up ANTLR docker CI so we can maintain official Docker images at antlr/antlr4 without users needing to build locally.
  • Add a Windows startup script too

Thanks for your project! It's awesome.

Matt

Signed-off-by: Matt Wildoer <mattwildoer@Matts-MacBook-Air.local>
@ericvergnaud
Copy link
Contributor

ericvergnaud commented Apr 22, 2023 via email

@mawildoer
Copy link
Author

Thanks Eric!

The reason I created a new Dockerfile was because I can see two use-cases for these images:

  1. The existing image which builds ANTLR seems valuable for development and validation of new features
  2. This new simplified image is valuable for ANTLR users to run the existing release of ANTLR

Additionally, I expected the existing Dockerfile would be used be someone (perhaps even CI?), so I didn't want to change it's behaviour too drastically without more consultation.

I would certainly like to avoid having two Docker directories in the project's root directory though. Perhaps there's a better place to put both of them?

Regards,

Matt

@ericvergnaud
Copy link
Contributor

Hi,
thanks for your clarifications, but I'm not aware of anyone using docker for development and validation of new features of ANTLR.
Rather, the purpose of the existing image is exactly the same as yours i.e. ensure proper versions of required components are installed in a consistent and isolated manner.
My suggestion would be to have 2 images: 1 for x86 and 1 for ARM.
May I encourage you to evolve this PR accordingly ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants