1 Star 0 Fork 0

1991wangliang / vscode-springboot

加入 Gitee
与超过 600 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未指定开源许可证,未经作者的许可,此代码仅用于学习,不能用于其他用途。
克隆/下载
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README.md

vscode-springboot docker-compose (postgresql + springboot-web)

lorne 2021-08-18

image

Setting remote docker ssh

  • create .vscode/settings.json file
{
    "docker.host": "ssh://root@10.13.14.123"
}

Using SSH requires a supported SSH client, that you have key based authentication configured for the remote host, and that the key is imported into your local SSH agent. See the article on using SSH Keys with Git for details on configuring the agent and adding your key.

image

Remote Container: Clone Repository from container volume

image

  • entity init project

SpringBoot Project Build and Setting

  • wait docker build and project build

image

  • note install lombok extension with flow errors.
The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted.

install lombok for Language Support for Java

image

Run SpringBoot

  • run SpringBootApplication

image

  • open browser see page

image

Remote Container Dev has 2 Ways

There's two variations of this setup. The first is to create your remote dev container first, and then clone your source code into a named volume since this does not require you to have direct access to the filesystem on the remote host.

Here is a basic devcontainer.json example of this setup:

{
  "image": "node", // Or "dockerFile"
  "workspaceFolder": "/workspace",
  "workspaceMount": "source=remote-workspace,target=/workspace,type=volume"
}

In fact, the Remote-Containers: Clone Repository in Container Volume... command in the Command Palette (F1) uses this same technique. If you already have a devcontainer.json file in a GitHub repository that references an image or Dockerfile, the command will automatically use a named volume instead of a bind mount - which also works with remote hosts.

The second approach is to bind mount a folder on the remote machine into your container. This requires you to have access to the remote filesystem, but also allows you to work with existing source code on the remote machine.

Update the workspaceMount property in the example above to use this model instead:

"workspaceMount": "source=/absolute/path/on/remote/machine,target=/workspace,type=bind,consistency=cached"

In either case, to try it out, run Remote-Containers: Open Folder in Container..., and select the local folder with the .devcontainer.json file in it.

links:

Developing inside a Container using Visual Studio Code Remote Development

Advanced Container Configuration

仓库评论 ( 0 )

你可以在登录后,发表评论

简介

暂无描述 展开 收起
Java 等 2 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/wangliang1991/vscode-springboot.git
git@gitee.com:wangliang1991/vscode-springboot.git
wangliang1991
vscode-springboot
vscode-springboot
main

搜索帮助