markdownlint icon indicating copy to clipboard operation
markdownlint copied to clipboard

Update Dockerfile and remove entrypoint

Open lesinigo opened this issue 4 years ago • 9 comments

I've updated and modified Dockerfile a bit, nothing here is necessary a "fix" but IMHO it is a little better now.

  • newer Alpine linux release
  • smaller image with no dev tools: < 22MiB versus the previous 218MiB
  • remove ENTRYPOINT, removing the need to override it in CI scripts
  • update README accordingly

lesinigo avatar Jul 26 '21 13:07 lesinigo

Please note the ENTRYPOINT change will break compatibility with scripts made for the previous Docker images, IMHO this is for the better.

lesinigo avatar Jul 26 '21 13:07 lesinigo

Thanks!

This seems sane to me. One would hope people specify a version of the docker container, so I'm not overly worried about the breaking change... but can you tell me how to validate ruby-concurent-ruby has the etc module in it?

Also you have some test failures. :)

jaymzh avatar Jul 26 '21 22:07 jaymzh

@jaymzh I'm using apk packages so any dependency should have been taken care of by the packager.

In this case it is not installing ruby-etc and mdl seems to be running just fine from the generated container image, I guess etc is not really needed.

For my local development I usually run some smoke tests in CI on the generated images, eg. to check that mdl --version or mdl SomeTestFile.md run correctly, so I can be sure there is nothing missing. At the very minimum, just doing a docker build on your local machine and testing the resulting image should be enough.

Also, speaking about tags, it is possible to automate builds on the docker hub triggered from github tags and do your own custom tagging after the build: you can look at an example in this unrelated repo and I can put together a PR for markdownlint if you are interested.

lesinigo avatar Jul 27 '21 07:07 lesinigo

Regarding the test failures, seems like rubocop is just complaining about old unsupported ruby versions, it is probably unrelated to my PR (please note that recent Alpine releases are using ruby 2.7).

lesinigo avatar Jul 27 '21 07:07 lesinigo

https://github.com/markdownlint/markdownlint/pull/387 will fix the tests.

I'd super appreciate the auto build-and-tag of docker images based on our tags!

jaymzh avatar Jul 30 '21 23:07 jaymzh

I would like to use this image in my GitLab pipelines, so a smaller version without an entrypoint like this would be highly appreciated. Is there any update on this?

My current workaround is overwriting the entrypoint like this:

lint-markdown:
    image:
        name: markdownlint/markdownlint:0.11.0
        entrypoint: [""]
    script:
        -   mdl README.md
    stage: lint

Bengt avatar Nov 30 '21 17:11 Bengt

Oh sorry, dropped off my radar.

@lesinigo - can you rebase and make sure the tests pass? Then I'll merge.

And I would love a PR for the autobuilds.

jaymzh avatar Nov 30 '21 17:11 jaymzh

Ping, @lesinigo ?

jaymzh avatar May 17 '22 23:05 jaymzh

Ping @lesinigo

jaymzh avatar Sep 30 '22 02:09 jaymzh

No response for a year, closing.

jaymzh avatar Sep 06 '23 21:09 jaymzh