jamestthompson3 / nvim-remote-containers

Develop inside docker containers, just like VSCode
Other
876 stars 26 forks source link

:BuildImage issue with finding dockerfile. #31

Open wallyschag opened 8 months ago

wallyschag commented 8 months ago
E5108: Error executing lua ...cal/share/nvim/lazy/nvim-remote-containers/lua/utils.lua:62: must have an image, dockerfile, or docker-compose file                         
stack traceback:                                                                                                                                                          
        [C]: in function 'error'                                                                                                                                          
        ...cal/share/nvim/lazy/nvim-remote-containers/lua/utils.lua:62: in function 'parseConfig'                                                                         
        ...al/share/nvim/lazy/nvim-remote-containers/lua/docker.lua:190: in function 'buildImage'                                                                         
        [string ":lua"]:1: in main chunk

I am in the root directory of my project and my root directory contains the .devcontainer folder with the devcontainer.json file and Dockerfile files. Is my dockerfile named incorrectly? Thanks.

jamestthompson3 commented 8 months ago

What does your devcontainer.json file look like? This error is thrown when we can't find an image, dockerfile, or docker-compose file mentioned in the devcontainer.json file.

wallyschag commented 8 months ago

nvim-docker

Does it have something to do with the "dockerfile:" option in my devcontainer.json file?

wallyschag commented 8 months ago

My dockerfile in my .devcontainer file is named Dockerfile.

Laurent45 commented 3 months ago

Hello @wallyschag,

I analyzed the source code and noticed a small difference in the devcontainer.json file compared to vscode. If you want to run a Dockerfile with :BuildImage, you need to change "dockerfile" to "dockerFile", like this: { "dockerFile": "./.devcontainer/Dockerfile" } Be careful with the capitalization between "dockerfile" and "dockerFile".

thamwangjun commented 2 weeks ago

@jamestthompson3 I think this is a bug. Based on the reference json schema here it should accommodate dockerfile and dockerFile. Can I bring a PR in to fix this?

Rich107 commented 2 weeks ago

Wow 7 hours ago, I am also having an issue with this great timing :) @thamwangjun.

jamestthompson3 commented 2 weeks ago

@jamestthompson3 I think this is a bug. Based on the reference json schema here it should accommodate dockerfile and dockerFile. Can I bring a PR in to fix this?

Feel free to contribute if you have a solution! Thanks for raising the issue!