Usage:
chmod +x code_attach
code_attach <container_name> <path> <docker_context>
- container_name: name of the running container
- path: path inside container (optional)
- docker_context: name of the docker context (optional)
Get the Container Name:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c37f6631e013 deepstream-hp "/bin/bash" 19 hours ago Up 2 hours hardcore_wu <----------
b5a123ad0c58 deepstream "/bin/bash" 8 days ago Up 6 days epic_cannon
If not is not present it may be stopped? (docker container ls -a
), then you need to start it first: docker start hardcore_wu
In my case I am connected to a custom docker context called "xavier" (you can see the active docker context using docker context ls
):
code_attach hardcore_wu /workspace xavier