Files
mrvacommander/client/containers/vscode/README.org
2024-09-12 14:05:59 -07:00

77 lines
1.8 KiB
Org Mode

* MRVA VS Code server container
On the host:
- Build the container via
#+BEGIN_SRC sh
make csi
#+END_SRC
- Run the container via
#+BEGIN_SRC sh
make csi-serve
#+END_SRC
- Connect to it at http://localhost:9080/?folder=/home/coder, password is =mrva=.
Inside the container:
- Setup inside the container
#+BEGIN_SRC shell
cd
export PATH=/opt/codeql:$PATH
codeql pack init qldemo
cd qldemo
codeql pack add codeql/python-all@1.0.6
#+END_SRC
- Open a new file =qldemo/simple.ql= and add this this query to it. The plugin
will download the CodeQL binaries (but never use them -- the configuration
redirects)
#+BEGIN_SRC sh
cd
cat > qldemo/simple.ql <<eof
import python
select 42
eof
#+END_SRC
- Create database.
#+BEGIN_SRC sh
cd ~/qldemo
cat > short.py <<EOF
print('hello world')
EOF
export PATH=/opt/codeql:$PATH
codeql database create --language=python -s . -v short-db
#+END_SRC
- Set the database as default and run the query =simple.ql=
- Capture the state of this container and create a new image from it
#+BEGIN_SRC sh
docker ps
docker commit 3802c3e9ad8c code-server-initialized:0.1.24
# sha256:76cfebdd75a69bcaa8020d06fec52593bd5fde06a100c1962f3201af809bfac0
docker kill 3802c3e9ad8c
# Make sure the image tag matches the sha
docker inspect code-server-initialized:0.1.24 |grep Id
# "Id": "sha256:76cfebdd75a69bcaa8020d06fec52593bd5fde06a100c1962f3201af809bfac0",
# Run the image and check
docker run -d -p 9080:9080 code-server-initialized:0.1.24
#+END_SRC
- Push this container
#+BEGIN_SRC sh
make csi-push
#+END_SRC
- Test the registry image
#+BEGIN_SRC sh
make csi-test
#+END_SRC