Hi,
I'm trying to use this with our project, but have a few issues. Both
configs work fine in Visual Studio Code.
1) We have two devcontainer.json files, one which uses the public and
one for our team. Is there a way to control which decontainer.json
file is used?
- https://github.com/privacyguides/privacyguides.org/blob/main/.devcontainer/devcontainer.json
- https://github.com/privacyguides/privacyguides.org/blob/main/.devcontainer/team/devcontainer.json
If I just do :DevcontainerStart it builds the first
.devcontainer/devcontainer.json one and not the team one
.devcontainer/team/devcontainer.json, that seems to be by design it
looks for the nearest one. Is there some way to give this command a
path?
2) The other problem I am having is with the parameters for
postCreateCommand:
I see this error:
Executing command /bin/sh -c git submodule init; git submodule update theme/assets/brand;
In the logs I see:
"podman" command ({ "image", "inspect", "nvim_dev_container_varhomedngraysrcdngraypgprivacyguides.org", "--format", "{{.RootFS.Layers}}" }): "Error: nvim_dev_container_varhomedngraysrcdngraypgprivacyguides.org: image not known\n
Then if I remove this portion from the postCreateCommand it seems to
build:
apk add bash; /bin/bash run.sh --cmd=mkdocs --cmd_flags=--dev-addr=0.0.0.0:8000
We need bash in order to run the shell script that starts everything:
https://github.com/privacyguides/privacyguides.org/blob/main/run.sh
--
Daniel Gray
0x41911F722B0F9AE3
The container certainly works if I run podman directly:
git clone https://github.com/privacyguides/privacyguides.org.git
cd privacyguides.org
podman run -it --replace \
-p 127.0.0.1:8000:8000 \
-v $PWD:/docs:z \
--name pg \
--entrypoint "sh" ghcr.io/squidfunk/mkdocs-material:9.5.18 \
-c "git submodule init; git submodule update theme/assets/brand; apk add bash; /bin/bash run.sh --cmd=mkdocs --cmd_flags=--dev-addr=0.0.0.0:8000"
So there shouldn't be anything wrong with the entrypoint command.
--
Daniel Gray
0x41911F722B0F9AE3
On Sun Apr 14, 2024 at 6:48 AM CEST, Daniel Gray wrote:
> Hi,>> I'm trying to use this with our project, but have a few issues. Both> configs work fine in Visual Studio Code.>> 1) We have two devcontainer.json files, one which uses the public and> one for our team. Is there a way to control which decontainer.json> file is used?>> - https://github.com/privacyguides/privacyguides.org/blob/main/.devcontainer/devcontainer.json> - https://github.com/privacyguides/privacyguides.org/blob/main/.devcontainer/team/devcontainer.json>> If I just do :DevcontainerStart it builds the first> .devcontainer/devcontainer.json one and not the team one> .devcontainer/team/devcontainer.json, that seems to be by design it> looks for the nearest one. Is there some way to give this command a> path?>
Hi, thanks for reporting this. This is currently not supported, but
should be fairly simple to add and I think it is a good suggestion. If
you are interested, feel free to open a PR or send a patch, otherwise, I
can get to it in a couple of days.
> 2) The other problem I am having is with the parameters for> postCreateCommand:>> I see this error:> Executing command /bin/sh -c git submodule init; git submodule update theme/assets/brand;>> In the logs I see: > "podman" command ({ "image", "inspect", "nvim_dev_container_varhomedngraysrcdngraypgprivacyguides.org", "--format", "{{.RootFS.Layers}}" }): "Error: nvim_dev_container_varhomedngraysrcdngraypgprivacyguides.org: image not known\n>> Then if I remove this portion from the postCreateCommand it seems to> build:> apk add bash; /bin/bash run.sh --cmd=mkdocs --cmd_flags=--dev-addr=0.0.0.0:8000>> We need bash in order to run the shell script that starts everything:> https://github.com/privacyguides/privacyguides.org/blob/main/run.sh
This seems like a bug on plugins end, but I need some more information.
Do you mind running plugin in debug mode (as described here: https://codeberg.org/esensar/nvim-dev-container/src/branch/main/CONTRIBUTING.md#reporting-bugs).
--
Ensar Sarajčić
w: www.ensarsarajcic.com
> Hi, thanks for reporting this. This is currently not supported, but> should be fairly simple to add and I think it is a good suggestion. If> you are interested, feel free to open a PR or send a patch, otherwise,> I can get to it in a couple of days.
I'm not sure how this should be implemented, but I'd appreciate it if
you found the time :) I'm sure it would be useful to others as well.
> This seems like a bug on plugins end, but I need some more> information.> Do you mind running plugin in debug mode (as described here:> https://codeberg.org/esensar/nvim-dev-container/src/branch/main/CONTRIBUTING.md#reporting-bugs).
Sure. I attached the log.
--
Daniel Gray
0x41911F722B0F9AE3
On Tue Apr 23, 2024 at 6:48 AM CEST, Daniel Gray wrote:
> I'm not sure how this should be implemented, but I'd appreciate it if> you found the time :) I'm sure it would be useful to others as well.>
I will get to it these days. I think it shouldn't be difficult.
>> Sure. I attached the log.
Thanks for the log. It seems the issue was in starting of the container.
Thanks for reporting this, since it seems that there was an issue
starting containers that had an entrypoint defined. In these cases
command was not properly overriden (in your case the container has
`mkdocs` set as its entrypoint, so it immediately exited, since it
received no arguments). That should work now, try fetching latest
version of the plugin and let me know if it works for you.
--
Ensar Sarajčić
w: www.ensarsarajcic.com