Closed jkuester closed 1 year ago
FYI this was developed and tested on Linux, but I also have tested that this process works on Windows too! Using WSL, I was able to build the Docker image and then VSCode seamlessly picked up the image and everything worked as expected.
@jkuester - good stuff! I think we're close, but I think the docs in the readme need help. I got stuck because I've literally never used VSCode to write code (just as a nice text editor for .txt files). I didn't really know how to create a workspace and when I thought I did, and added the .devcontainer.json
file, choosing Reopen in Container
didn't work - instead t was prompting me to define a container or something? Video below.
I think we should be prescriptive toward a CHT experience - adding a new CHT app project with app settings initialized etc. And, yes, add a pre-built and published image (5 min build time for me both times!).
I'll grab ya tomorrow and we'll figure it out!
https://user-images.githubusercontent.com/8253488/222061857-0228fc86-fba7-4e98-871f-c76f7fbd44f5.mp4
FYI this was developed and tested on Linux, but I also have tested that this process works on Windows too! Using WSL, I was able to build the Docker image and then VSCode seamlessly picked up the image and everything worked as expected.
FYI, I just tested the README
steps in MacOS with M1 chip, and everything ran correctly. 🎆
The only hiccup I encountered was when using VSCode's integrated terminal, where I got the error below. I didn't investigate further, and just used my Mac's terminal instead.
For the record, the problem encountered by @mrjones-plip as due to his .devcontainer.json
being located at ./test/.devcontainer.json
and not in the root of the workspace at ./.devcontainer.json
.
Also, @andrablaj, your error is coming because you are trying to mix the usage modes! :smile: When using VSCode's integrated terminal (while having VSCode open in the Dev Container) the terminal is running in the container environment and not in your host environment. So, even though you have docker installed on your host machine, you cannot use the docker
command from VSCode's integrated terminal because Docker is not installed inside the container! To run cht
commands from within VSCode, you don't need the extra docker run ...
stuff. You can just run cht ...
.
I will update the documentation here to be more clear on all these points!
Thanks @jkuester. 🙌 An update to the documentation would help, as more people might bump into the same question. I am stepping out of this PR, unless you need extra testing on MacOS. If it is the case, just ping me, I am happy to help.
@Hareet I noticed that you were the one who originally created the Dockerfile here in cht-conf. Before we haul-off and make fundamental changes here, I wanted to check and see if you all were using this for some kind of scripting somewhere that we should be aware of (so we don't inadvertently break anything)?
@mrjones-plip I made a few minor updates here:
cht-ide
wording for consistency with the upcoming published Docker imagepython3-wheel
package to the Dockerfile to resolve an error that was being printed when installing pyxform (the old Dockerfile had the package, but I removed it because I did not understand what it was for. Putting it back now because I saw the error....):tada: This PR is included in version 3.16.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Updates the existing
Dockerfile
:cht-conf-test-harness
(e.g.xsltproc
)cht
command as the ENTRYPOINT (to allow for streamlined command execution)Adds documentation for how to use the image as a VSCode Dev Container or as a standalone Docker utility.
Closes #542
Not included
The following are not included (yet) in this MVP PR. Part of this review should be deciding if any of these are necessary for merging this PR (or if they can be added later).
cht-conf
repo and build the image yourself. These steps would be unnecessary if we had GH Action steps that would build/deploy images publicly.--accept-self-signed-certs
flag. There are probably better ways to do this.my.local-ip.co
addresses should work fine as long as the port is open, so perhaps this is not too big of a deal. If someone is actually running a development instance of the CHT on their bare-metal local machine, they probably already have the dependencies they need to use cht-conf....Code review items
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.