nvim icon indicating copy to clipboard operation
nvim copied to clipboard

Trying to figure out a way to bootstrap packer in `dockerfile`

Open milanglacier opened this issue 3 years ago • 5 comments

Hi! I am trying to containerizing my config just as yours, and your dockerfile gives me a lot of help! Thanks for sharing your dockerfile!

The last thing I am missing is: I want to bootstrap my packer and download nvim plugins within dockerfile, however I find that running --headless will make nvim stuck and never quit, so the dockerfile cannot finish to build. So I can't bootstrap packer and download plugins in the dockerfile.

RUN nvim --headless

Bootstrapping in dockerfile is important because that in some servers with strict network limitation where github isn't viable, I don't want to start an image that isn't completely set to work.

milanglacier avatar Aug 07 '22 06:08 milanglacier

Hello, unfortunately I didn't got it to work anymore. The part I commented out in this commit used to work but pls have a look at #8 and the workaround described by @partounian. Maybe this helps you.

Allaman avatar Aug 07 '22 13:08 Allaman

I figure out the reason, don't set the option max_jobs for packer.init when it is in headless mode. And everything runs smoothly.

milanglacier avatar Aug 08 '22 05:08 milanglacier

This is great news! Unfortunately, running :PackerSync (not in Docker context) gets stuck without this setting. Can you confirm this?

Allaman avatar Aug 08 '22 10:08 Allaman

yes, it has the issue. But is is not related to in docker or not, it is about in headless mode or in TUI mode. In TUI mode, max_jobs are needed to be set, and in headless mode, max_jobs should be nil.

milanglacier avatar Aug 08 '22 12:08 milanglacier

Thanks for your clarification. I made a small workaround that should fix this issue - pls give it a try

Allaman avatar Aug 08 '22 18:08 Allaman