I've a vps sever , and installed linux and docker on it, is there any way to connect the image with my vscode so that if I want to change any thing ,not to rebuild image and reupload it to docker on vps
Yes, it is possible to connect to a Docker container using VS Code. Here is more info https://code.visualstudio.com/docs/devcontainers/attach-container
You can also connect to a Docker container running inside a WSL, by connecting to the WLS instance from VS Code.
Related
I've been running into an issue testing out a working, compliant docker environment. While Docker-CE on Ubuntu would work, getting the Docker Desktop app to work may be more viable in creating a compliant docker environment (ease of control). I run into this error when trying to pull from the Docker Desktop app:
This happens on both the corporate network and off, as well as on the VPN. There are no instances where I can successfully pull when using Docker Desktop. Using Docker on WSL on the same computer on the same network I can successfully use its full functionality. Please let me know if you have a solution to this. Thank you!
With the VS Code extension Visual Studio Code Remote - Containers I can develop inside a container that is spun up on my local computer via Docker Desktop.
Is there any way to develop inside a container hosted on Azure, AWS, Google Cloud, or any other cloud system instead?
I can't use Docker Desktop locally because I'm on a Macbook Pro with Apple Silicon, meaning that Docker does not work the same way as it would on an Intel chip.
UPDATE 2021-12-04:
I solved the issue by using GitHub Codespaces
You can use docker context
It forwards the remote docker socket via ssh to your local machine
docker context create NAME_OF_THE_CONTEXT --docker "host=ssh://$SERVER_USER_NAME#$SERVER_IP"
Use the context
docker context use NAME_OF_THE_CONTEXT
Now you can run docker commands in your local terminal that will be executed on the remote host.
So now you can connect to remote containers via VSCode as if the containers are running remotely.
I am very new to Docker as a whole.
I have a VPS with Debian 10 Buster, running Docker. I also installed Docker Desktop on my windows 10 pc. I like the GUI, and I googled if i can manage my VPS docker with this application, but found no answear.
Is this possible, or am i missing something obvious?
While I have not been able to connect the Windows 10 Docker Desktop application to my Docker engine running on my Debian 10 VPS, I found an alternative:
portainer.io
This is a service, with a free plan option(CE). You install this docker image following their documentation, and it runs on the host machine, in my case, the Debian VPS. I use this image on port 9000, so all I have to do to access it is open a browser and navigate to http://HOSTIPADDRESS:9000.
There you will find a gui similar to the Docker Desktop application.
I am running a cuda enabled docker container inside wsl2 and when i try to use VSCode to run scripts inside it i cannot connect to it. The message in the docker plugin window is:
Error: connect EACCESS /var/run/docker.sock
I added the default user in the wsl to the docker group. I double-checked and i know for sure that i can run docker as a user. How do I elevate the VSCode privillages to make it able to access the docker inside the wsl image?
Btw. I cannot use docker desktop because it does not allow to use the gpu inside the container.
UPDATE
So with the set of plugins locally:Docker, Remote - WSL, Remote - Containers, Remote SSH, Remote Development, Remote SSH - editing configuration files
in the WSL: Docker Explorer, Docker, Docker Extension Pack
I am able to log from VSCode directly to the console and perform other basic operations (starting containers etc). Attaching VSCode is still impossible as for now. At least the menu option under RMB throws an error
I am trying to setup and advanced configuration with VScode insider and I ma facing an issue.
My setup is:
VSCode Running in my local machine Windows 10 with a Django source code hosted on my machine. I have no docker client on this machine, and I don't wont to install one...
A virtual machine with Ubuntu is running a docker daemon, docker client and docker-compose. My workspace is shared over vboxfs and mounted on my Ubuntu
A python docker container is running in the Ubuntu machine and running the mounted code.
I tried to use the Remote Extension to debug the python code inside the container. However, when a run my vscode inside on the remote SSH Taget (so the ubuntu machine), I am able to manage docker objects (images, containers, etc...) using the Docker extension of vscode, but I can't see the option: Remote-Containers: Open Folder in Container. It's not found in the F1 command... I can see the other related command like: Remote-Containers: Settings.
Do you have any idea ? Or my setup is not supported by the extension ? It seems like it supports SSH development or Container development but not mixing both together, right ?
Is there any other VSCode config to debug in my targeted setup ?
Regards